Merge remote-tracking branch 'lanjuMes/master' into mes

master
FCD 1 week ago
commit e29347b65f

@ -9,10 +9,19 @@ public class SapRFW {
private String aufnr;
private String gamng;
private String anzma;
private String budat;
private String remark;
private lt_gs lt_gs;
private List<lt_hw> lt_hwList;
public String getBudat() {
return budat;
}
public void setBudat(String budat) {
this.budat = budat;
}
public String getRemark() {
return remark;
}

@ -159,4 +159,5 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
}

@ -25,240 +25,240 @@ import java.util.Map;
* @author OP
*/
public class ExcelReportMapUtil {
//下载
public static <T> SXSSFWorkbook initWorkbook(String sheetName , String title, List<ExcelCol> excelCol , List<T> data, Map<String,String> detailMap) throws IOException {
SXSSFWorkbook workbook = new SXSSFWorkbook();
int colSize = excelCol.size();
//下载
public static <T> SXSSFWorkbook initWorkbook(String sheetName , String title, List<ExcelCol> excelCol , List<T> data, Map<String,String> detailMap) throws IOException {
SXSSFWorkbook workbook = new SXSSFWorkbook();
int colSize = excelCol.size();
//创建Sheet工作簿
Sheet sheet = null;
if (!StringUtils.hasText(sheetName)){
sheet = workbook.createSheet();
}else{
sheet = workbook.createSheet(sheetName);
}
//创建Sheet工作簿
Sheet sheet = null;
if (!StringUtils.hasText(sheetName)){
sheet = workbook.createSheet();
}else{
sheet = workbook.createSheet(sheetName);
}
// 从resources目录获取图片字节数组
byte[] imageBytes = getImageBytesFromResources("image/logo.png");
/**logo**/
int pictureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE_PNG);
CreationHelper helper = workbook.getCreationHelper();
Drawing<?> drawing = sheet.createDrawingPatriarch();
ClientAnchor anchor = helper.createClientAnchor();
anchor.setCol1(0); // B列
anchor.setRow1(0); // 第2行Excel的行和列都是从0开始计数的
anchor.setCol2(1); // C列图片宽度跨越的列数这里设置为1列宽
anchor.setRow2(2); // 第6行图片高度跨越的行数这里设置为4行高可以根据图片大小调整
Picture pict = drawing.createPicture(anchor, pictureIdx);
pict.resize(); // 根据图片的实际大小调整图片在Excel中的显示大小
/**报告标题**/
sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 11));
// 获取合并后的单元格的第一个单元格即C1并设置值
Row row1 = sheet.getRow(0); // 获取第1行索引为0
if (row1 == null) {row1 = sheet.createRow(0); // 如果第1行不存在则创建它
}
Cell cell = row1.getCell(2); // 获取C列索引为2的单元格
if (cell == null) {
cell = row1.createCell(2); // 如果C列的单元格不存在则创建它
}
cell.setCellValue("中山榄菊日化实业有限公司"); // 设置单元格的值
cell.setCellStyle(getTitelStyle(workbook)); // 应用样式到单元格
/**报告二级标题、检验标准**/
// 合并C3到I4的单元格并设置样式
mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 2, 8), detailMap.get("title"));
// 合并J3到L4的单元格并设置样式
mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 9, 12), "编码:"+detailMap.get("fileNo"));
/**左右表格1**/
//画边框
for(int r5=4;r5<13;r5++){
Row row05 = sheet.getRow(r5);
if (row05 == null) {row05 = sheet.createRow(r5);}
for (int col = 0; col < 14; col++) {
Cell cell1 = row05.createCell(col);
cell1.setCellStyle(getRowStyle(sheet));
}
}
for(int d5=13;d5<(13+data.size());d5++){
Row row05 = sheet.getRow(d5);
if (row05 == null) {row05 = sheet.createRow(d5);}
for (int col = 0; col < 14; col++) {
Cell cell1 = row05.createCell(col);
cell1.setCellStyle(getDataStyle(sheet));
}
}
// 从resources目录获取图片字节数组
byte[] imageBytes = getImageBytesFromResources("image/logo.png");
/**logo**/
int pictureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE_PNG);
CreationHelper helper = workbook.getCreationHelper();
Drawing<?> drawing = sheet.createDrawingPatriarch();
ClientAnchor anchor = helper.createClientAnchor();
anchor.setCol1(0); // B列
anchor.setRow1(0); // 第2行Excel的行和列都是从0开始计数的
anchor.setCol2(1); // C列图片宽度跨越的列数这里设置为1列宽
anchor.setRow2(2); // 第6行图片高度跨越的行数这里设置为4行高可以根据图片大小调整
Picture pict = drawing.createPicture(anchor, pictureIdx);
pict.resize(); // 根据图片的实际大小调整图片在Excel中的显示大小
/**报告标题**/
sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 11));
// 获取合并后的单元格的第一个单元格即C1并设置值
Row row1 = sheet.getRow(0); // 获取第1行索引为0
if (row1 == null) {row1 = sheet.createRow(0); // 如果第1行不存在则创建它
}
Cell cell = row1.getCell(2); // 获取C列索引为2的单元格
if (cell == null) {
cell = row1.createCell(2); // 如果C列的单元格不存在则创建它
}
cell.setCellValue("中山榄菊日化实业有限公司"); // 设置单元格的值
cell.setCellStyle(getTitelStyle(workbook)); // 应用样式到单元格
/**报告二级标题、检验标准**/
// 合并C3到I4的单元格并设置样式
mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 2, 8), detailMap.get("title"));
// 合并J3到L4的单元格并设置样式
mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 9, 12), "编码:"+detailMap.get("fileNo"));
/**左右表格1**/
//画边框
for(int r5=4;r5<13;r5++){
Row row05 = sheet.getRow(r5);
if (row05 == null) {row05 = sheet.createRow(r5);}
for (int col = 0; col < 14; col++) {
Cell cell1 = row05.createCell(col);
cell1.setCellStyle(getRowStyle(sheet));
}
}
for(int d5=13;d5<(13+data.size());d5++){
Row row05 = sheet.getRow(d5);
if (row05 == null) {row05 = sheet.createRow(d5);}
for (int col = 0; col < 14; col++) {
Cell cell1 = row05.createCell(col);
cell1.setCellStyle(getDataStyle(sheet));
}
}
Row row5 = sheet.getRow(4);
// 合并A5到B6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 0, 1), "来料类别", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 2, 3), detailMap.get("productGroupName"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 4, 5), "生产批号", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 6, 8), detailMap.get("incomeBatchNo"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 9, 10), "报告编号", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 11, 13), detailMap.get("checkNo"), true, false, null);
Row row7 = sheet.getRow(6);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 0, 1), "物料名称", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 2, 3), detailMap.get("materialName"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 4, 5), "物料编码", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 6, 8), detailMap.get("materialCode"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 9, 10), "供应单位", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 11, 13), detailMap.get("supplierName"), true, false, null);
Row row9 = sheet.getRow(8);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 0, 1), "供应编码", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 2, 3), detailMap.get("supplierCode"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 4, 5), "来料数量", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9,6, 8), detailMap.get("quality"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 9, 10), "单位", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 11, 13), detailMap.get("unit"), true, false, null);
Row row10 = sheet.getRow(10);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 0, 1), "物料来源", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 2, 3), detailMap.get("checkType"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 4, 5), "检验依据", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11,6, 8), detailMap.get("standardNo"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 9, 10), "报检日期", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 11, 13), detailMap.get("incomeTime"), true, false, null);
/**上下表格2**/
Row row12 = sheet.getRow(12);
if (row12 == null) {row12 = sheet.createRow(12);}
Cell cellA13 = row12.createCell(0);
cellA13.setCellValue("序号");
cellA13.setCellStyle(getRowStyle(sheet));
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 1, 4), "检验项目");
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 5, 8), "标准要求");
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 9, 10), "实测结果");
Cell cellL13 = row12.createCell(11);
cellL13.setCellValue("判定");
cellL13.setCellStyle(getRowStyle(sheet));
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 12, 13), "附件");
//将data中的值填充到excel
int rowNum = 13;
if(!CollectionUtils.isEmpty(data)){
Iterator<T> iterator = data.iterator();
//遍历数据
for (;iterator.hasNext();){
Row row5 = sheet.getRow(4);
// 合并A5到B6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 0, 1), "来料类别", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 2, 3), detailMap.get("productGroupName"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 4, 5), "生产批号", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 6, 8), detailMap.get("incomeBatchNo"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 9, 10), "报告编号", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 11, 13), detailMap.get("checkNo"), true, false, null);
Row row7 = sheet.getRow(6);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 0, 1), "物料名称", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 2, 3), detailMap.get("materialName"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 4, 5), "物料编码", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 6, 8), detailMap.get("materialCode"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 9, 10), "供应单位", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 11, 13), detailMap.get("supplierName"), true, false, null);
Row row9 = sheet.getRow(8);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 0, 1), "供应编码", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 2, 3), detailMap.get("supplierCode"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 4, 5), "来料数量", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9,6, 8), detailMap.get("quality"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 9, 10), "单位", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row9, new CellRangeAddress(8, 9, 11, 13), detailMap.get("unit"), true, false, null);
Row row10 = sheet.getRow(10);
// 合并A7到B8的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 0, 1), "物料来源", true, true, IndexedColors.GREY_25_PERCENT);
// 合并C5到D6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 2, 3), detailMap.get("checkType"), true, false, null);
// 合并E5到F6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 4, 5), "检验依据", true, true, IndexedColors.GREY_25_PERCENT);
// 合并G5到I6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11,6, 8), detailMap.get("standardNo"), true, false, null);
// 合并J5到K6的单元格并设置样式和内容
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 9, 10), "报检日期", true, true, IndexedColors.GREY_25_PERCENT);
// 合并L5到N6的单元格并设置样式无背景色只有边框和内容居中
mergeAndStyleCells2(sheet,row10, new CellRangeAddress(10, 11, 11, 13), detailMap.get("incomeTime"), true, false, null);
/**上下表格2**/
Row row12 = sheet.getRow(12);
if (row12 == null) {row12 = sheet.createRow(12);}
Cell cellA13 = row12.createCell(0);
cellA13.setCellValue("序号");
cellA13.setCellStyle(getRowStyle(sheet));
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 1, 4), "检验项目");
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 5, 8), "标准要求");
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 9, 10), "实测结果");
Cell cellL13 = row12.createCell(11);
cellL13.setCellValue("判定");
cellL13.setCellStyle(getRowStyle(sheet));
mergeAndStyleCells(sheet, new CellRangeAddress(12, 12, 12, 13), "附件");
//将data中的值填充到excel
int rowNum = 13;
if(!CollectionUtils.isEmpty(data)){
Iterator<T> iterator = data.iterator();
//遍历数据
for (;iterator.hasNext();){
T obj = iterator.next();//获取当前行对应的数据
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj));
T obj = iterator.next();//获取当前行对应的数据
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj));
Row dataRow = sheet.getRow(rowNum);//创建行
// 假设使用了默认字体和字符宽度来计算行高(这是一个简化的示例)
int cellHeight = (int) (cell.getStringCellValue().length() * 6); // 每个字符大约15个单位高度
dataRow.setHeightInPoints(Math.max(dataRow.getHeightInPoints(), cellHeight));
Row dataRow = sheet.getRow(rowNum);//创建行
// 假设使用了默认字体和字符宽度来计算行高(这是一个简化的示例)
int cellHeight = (int) (cell.getStringCellValue().length() * 6); // 每个字符大约15个单位高度
dataRow.setHeightInPoints(Math.max(dataRow.getHeightInPoints(), cellHeight));
Cell cellData0 = dataRow.getCell(0);
cellData0.setCellValue(rowNum-12);
cellData0.setCellStyle(getDataStyle(sheet));
Cell cellData0 = dataRow.getCell(0);
cellData0.setCellValue(rowNum-12);
cellData0.setCellStyle(getDataStyle(sheet));
Cell cellData1 = dataRow.getCell(1);
cellData1.setCellValue(getValue(jsonObject.get(excelCol.get(0).getField())));
cellData1.setCellStyle(getDataStyle(sheet));
Cell cellData1 = dataRow.getCell(1);
cellData1.setCellValue(getValue(jsonObject.get(excelCol.get(0).getField())));
cellData1.setCellStyle(getDataStyle(sheet));
Cell cellData2 = dataRow.getCell(5);
cellData2.setCellValue(getValue(jsonObject.get(excelCol.get(1).getField())));
cellData2.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 5, 8));
Cell cellData2 = dataRow.getCell(5);
cellData2.setCellValue(getValue(jsonObject.get(excelCol.get(1).getField())));
cellData2.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 5, 8));
Cell cellData3 = dataRow.getCell(9);
cellData3.setCellValue(getValue(jsonObject.get(excelCol.get(2).getField())));
cellData3.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 9, 10));
Cell cellData3 = dataRow.getCell(9);
cellData3.setCellValue(getValue(jsonObject.get(excelCol.get(3).getField())));
cellData3.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 9, 10));
Cell cellData4 = dataRow.getCell(11);
cellData4.setCellValue(getValue(jsonObject.get(excelCol.get(3).getField())));
cellData4.setCellStyle(getDataStyle(sheet));
Cell cellData4 = dataRow.getCell(11);
cellData4.setCellValue(getValue(jsonObject.get(excelCol.get(4).getField())));
cellData4.setCellStyle(getDataStyle(sheet));
Cell cellData5 = dataRow.getCell(12);
cellData5.setCellValue(getValue(jsonObject.get(excelCol.get(4).getField())));
cellData5.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 12, 13));
iterator.remove();
rowNum++;
}
}
Cell cellData5 = dataRow.getCell(12);
cellData5.setCellValue(getValue(jsonObject.get(excelCol.get(2).getField())));
cellData5.setCellStyle(getDataStyle(sheet));
sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 12, 13));
iterator.remove();
rowNum++;
}
}
// 指定要检查的列索引例如B列的索引是1
int columnIndex = 1;
// 遍历所有行从第二行开始索引1因为第一行可能是标题行
for (int rowIndex = 13; rowIndex <= sheet.getLastRowNum(); ) {
Row currentRow = sheet.getRow(rowIndex);
if (currentRow != null) {
Cell currentCell = currentRow.getCell(columnIndex);
if (currentCell != null && currentCell.getCellType() == CellType.STRING) { // 假设我们处理字符串类型的单元格
String currentValue = currentCell.getStringCellValue();
// 指定要检查的列索引例如B列的索引是1
int columnIndex = 1;
// 遍历所有行从第二行开始索引1因为第一行可能是标题行
for (int rowIndex = 13; rowIndex <= sheet.getLastRowNum(); ) {
Row currentRow = sheet.getRow(rowIndex);
if (currentRow != null) {
Cell currentCell = currentRow.getCell(columnIndex);
if (currentCell != null && currentCell.getCellType() == CellType.STRING) { // 假设我们处理字符串类型的单元格
String currentValue = currentCell.getStringCellValue();
// 查找连续相同值的行
int lastRowIndex = rowIndex;
while (lastRowIndex + 1 <= sheet.getLastRowNum()) {
Row nextRow = sheet.getRow(lastRowIndex + 1);
if (nextRow != null) {
Cell nextCell = nextRow.getCell(columnIndex);
if (nextCell != null && nextCell.getCellType() == CellType.STRING &&
nextCell.getStringCellValue().equals(currentValue)) {
lastRowIndex++; // 继续向下查找
} else {
break; // 找到不同值,停止查找
}
} else {
break; // 没有更多行,停止查找
}
}
// 查找连续相同值的行
int lastRowIndex = rowIndex;
while (lastRowIndex + 1 <= sheet.getLastRowNum()) {
Row nextRow = sheet.getRow(lastRowIndex + 1);
if (nextRow != null) {
Cell nextCell = nextRow.getCell(columnIndex);
if (nextCell != null && nextCell.getCellType() == CellType.STRING &&
nextCell.getStringCellValue().equals(currentValue)) {
lastRowIndex++; // 继续向下查找
} else {
break; // 找到不同值,停止查找
}
} else {
break; // 没有更多行,停止查找
}
}
// 合并找到的行
if (rowIndex != lastRowIndex) { // 只有在找到连续相同值的行时才进行合并
sheet.addMergedRegion(new CellRangeAddress(rowIndex, lastRowIndex, 1, 4));
}else{
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 1, 4));
}
// 合并找到的行
if (rowIndex != lastRowIndex) { // 只有在找到连续相同值的行时才进行合并
sheet.addMergedRegion(new CellRangeAddress(rowIndex, lastRowIndex, 1, 4));
}else{
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 1, 4));
}
// 更新rowIndex以跳过已合并的行
rowIndex = lastRowIndex + 1; // 从下一个未合并的行开始继续遍历
} else {
// 如果当前单元格不是字符串类型,则直接跳到下一行
rowIndex++;
}
} else {
// 如果当前行为空,则直接跳到下一行
rowIndex++;
}
}
// 更新rowIndex以跳过已合并的行
rowIndex = lastRowIndex + 1; // 从下一个未合并的行开始继续遍历
} else {
// 如果当前单元格不是字符串类型,则直接跳到下一行
rowIndex++;
}
} else {
// 如果当前行为空,则直接跳到下一行
rowIndex++;
}
}
Row rowEnd1 = sheet.createRow(rowNum+2);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 0, 1), "综合检验结论", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 2, 3), detailMap.get("checkResult"), true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 5, 10), "备注:判定合格打“√”,不合格打“×”", true, true, null);
Row rowEnd2 = sheet.createRow(rowNum+5);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 0, 1), "品管经理/主任", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 2, 3), "", true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 5, 6), "品质主管", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 7, 8), "", true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 10, 11), "品管员", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 12, 13), detailMap.get("checkManName"), true, false, null);
Row rowEnd1 = sheet.createRow(rowNum+2);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 0, 1), "综合检验结论", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 2, 3), detailMap.get("checkResult"), true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 5, 10), "备注:判定合格打“√”,不合格打“×”", true, true, null);
Row rowEnd2 = sheet.createRow(rowNum+5);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 0, 1), "品管经理/主任", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 2, 3), "", true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 5, 6), "品质主管", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 7, 8), "", true, false, null);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 10, 11), "品管员", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 12, 13), detailMap.get("checkManName"), true, false, null);
Row rowEnd3 = sheet.createRow(rowNum+4);
mergeAndStyleCellsNoBorder(sheet, rowEnd3, new CellRangeAddress(rowNum+4, rowNum+4, 0, 1), "备注", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet, rowEnd3, new CellRangeAddress(rowNum+4, rowNum+4, 2, 13), detailMap.get("remark"), true, false, null);
Row rowEnd3 = sheet.createRow(rowNum+4);
mergeAndStyleCellsNoBorder(sheet, rowEnd3, new CellRangeAddress(rowNum+4, rowNum+4, 0, 1), "备注", true, true, IndexedColors.GREY_25_PERCENT);
mergeAndStyleCellsNoBorder(sheet, rowEnd3, new CellRangeAddress(rowNum+4, rowNum+4, 2, 13), detailMap.get("remark"), true, false, null);
// Row rowEnd3 = sheet.createRow(rowNum+8);
// mergeAndStyleCellsNoBorder(sheet,rowEnd3, new CellRangeAddress(rowNum+5, rowNum+5, 0, 1), "品管经理/主任", true, true, IndexedColors.GREY_25_PERCENT);
@ -266,8 +266,8 @@ public class ExcelReportMapUtil {
// mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+6, rowNum+6, 2, 13), detailMap.get("remark"), true, false, null);
return workbook;
}
return workbook;
}
// //标题样式
// public static CellStyle getHeaderFont(Workbook workbook){
@ -291,7 +291,7 @@ public class ExcelReportMapUtil {
// return cellStyle;
// }
// //内容样式
// //内容样式
// public static CellStyle getDataFont(Workbook workbook){
// Font font = workbook.createFont();
// font.setFontHeightInPoints((short) 12);//字体大小
@ -304,15 +304,15 @@ public class ExcelReportMapUtil {
// return cellStyle;
// }
//
//处理数据
public static String getValue(Object object){
if (object==null){
return "";
}else {
return object.toString();
}
}
// //处理数据
//处理数据
public static String getValue(Object object){
if (object==null){
return "";
}else {
return object.toString();
}
}
// //处理数据
// public static Integer getValueNum(Object object){
// if (object==null){
// return 0;
@ -320,163 +320,163 @@ public class ExcelReportMapUtil {
// return Integer.parseInt(object.toString());
// }
// }
// 从resources目录获取图片的字节数组
private static byte[] getImageBytesFromResources(String resourceName) {
try (InputStream inputStream = ExcelReportMapUtil.class.getClassLoader().getResourceAsStream(resourceName);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
// 从resources目录获取图片的字节数组
private static byte[] getImageBytesFromResources(String resourceName) {
try (InputStream inputStream = ExcelReportMapUtil.class.getClassLoader().getResourceAsStream(resourceName);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
if (inputStream == null) {
throw new RuntimeException("找不到资源: " + resourceName);
}
if (inputStream == null) {
throw new RuntimeException("找不到资源: " + resourceName);
}
IOUtils.copy(inputStream, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
IOUtils.copy(inputStream, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
} catch (IOException e) {
throw new RuntimeException("读取资源时出错: " + resourceName, e);
}
}
//报告大标题样式-1
public static CellStyle getTitelStyle(Workbook workbook){
Font font = workbook.createFont();
// 设置字体为加粗
font.setBold(true);
// 设置字体大小例如设置为16
font.setFontHeightInPoints((short) 24);
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setFont(font);
cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中
cellStyle.setWrapText(true);//设置单元格内容自动换行
return cellStyle;
}
public static CellStyle getRowStyle(Sheet sheet){
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
// 设置水平居中
style.setAlignment(HorizontalAlignment.CENTER);
style.setWrapText(true);//设置单元格内容自动换行
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
Font font = sheet.getWorkbook().createFont();
font.setBold(true);
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
return style;
}
public static CellStyle getDataStyle(Sheet sheet){
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
Font font = sheet.getWorkbook().createFont();
} catch (IOException e) {
throw new RuntimeException("读取资源时出错: " + resourceName, e);
}
}
//报告大标题样式-1
public static CellStyle getTitelStyle(Workbook workbook){
Font font = workbook.createFont();
// 设置字体为加粗
font.setBold(true);
// 设置字体大小例如设置为16
font.setFontHeightInPoints((short) 24);
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setFont(font);
cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中
cellStyle.setWrapText(true);//设置单元格内容自动换行
return cellStyle;
}
public static CellStyle getRowStyle(Sheet sheet){
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
// 设置水平居中
style.setAlignment(HorizontalAlignment.CENTER);
style.setWrapText(true);//设置单元格内容自动换行
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
Font font = sheet.getWorkbook().createFont();
font.setBold(true);
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
return style;
}
public static CellStyle getDataStyle(Sheet sheet){
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
Font font = sheet.getWorkbook().createFont();
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
style.setWrapText(true);//设置单元格内容自动换行
// 设置水平居中
style.setAlignment(HorizontalAlignment.LEFT);
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
private static void mergeAndStyleCells(Sheet sheet, CellRangeAddress cellRangeAddress, String cellValue) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
style.setWrapText(true);//设置单元格内容自动换行
// 设置水平居中
style.setAlignment(HorizontalAlignment.LEFT);
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
private static void mergeAndStyleCells(Sheet sheet, CellRangeAddress cellRangeAddress, String cellValue) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置字体为加粗
Font font = sheet.getWorkbook().createFont();
font.setBold(true);
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
// 设置字体为加粗
Font font = sheet.getWorkbook().createFont();
font.setBold(true);
// 设置字体大小例如设置为14
font.setFontHeightInPoints((short) 14);
style.setFont(font);
// 设置水平居中
style.setAlignment(HorizontalAlignment.CENTER);
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setWrapText(true);//设置单元格内容自动换行
// 获取合并后的单元格的第一个单元格,并设置值
Row row = sheet.getRow(cellRangeAddress.getFirstRow());
if (row == null) {
row = sheet.createRow(cellRangeAddress.getFirstRow());
}
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
private static void mergeAndStyleCells2(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 设置水平居中
style.setAlignment(HorizontalAlignment.CENTER);
// 设置垂直居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setWrapText(true);//设置单元格内容自动换行
// 获取合并后的单元格的第一个单元格,并设置值
Row row = sheet.getRow(cellRangeAddress.getFirstRow());
if (row == null) {
row = sheet.createRow(cellRangeAddress.getFirstRow());
}
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
private static void mergeAndStyleCells2(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置字体居中
if (centered) {
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
}
// 设置字体居中
if (centered) {
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
}
// 设置背景颜色(如果有)
if (hasBackground && backgroundColor != null) {
style.setFillForegroundColor(backgroundColor.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
}
// 设置背景颜色(如果有)
if (hasBackground && backgroundColor != null) {
style.setFillForegroundColor(backgroundColor.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
}
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
// 设置边框线
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
// 获取合并后的单元格的第一个单元格,并设置值
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
private static void mergeAndStyleCellsNoBorder(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 获取合并后的单元格的第一个单元格,并设置值
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
private static void mergeAndStyleCellsNoBorder(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) {
// 合并单元格
sheet.addMergedRegion(cellRangeAddress);
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 创建一个单元格样式
CellStyle style = sheet.getWorkbook().createCellStyle();
// 设置字体居中
if (centered) {
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
}
// 设置字体居中
if (centered) {
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
}
// 设置背景颜色(如果有)
if (hasBackground && backgroundColor != null) {
style.setFillForegroundColor(backgroundColor.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
}
// 设置背景颜色(如果有)
if (hasBackground && backgroundColor != null) {
style.setFillForegroundColor(backgroundColor.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
}
// 获取合并后的单元格的第一个单元格,并设置值
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
// 获取合并后的单元格的第一个单元格,并设置值
Cell cell = row.getCell(cellRangeAddress.getFirstColumn());
if (cell == null) {
cell = row.createCell(cellRangeAddress.getFirstColumn());
}
cell.setCellValue(cellValue); // 设置单元格的值
cell.setCellStyle(style); // 应用样式到单元格
}
}

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$" dumb="true">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
</component>
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
</module>

@ -27,7 +27,7 @@ if exist %df% (
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -1,6 +1,9 @@
package com.op.device.controller;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
@ -63,7 +66,14 @@ public class EquFaultDescriptionController extends BaseController {
@RequiresPermissions("device:faultDescription:query")
@GetMapping(value = "/{faultId}")
public AjaxResult getInfo(@PathVariable("faultId") String faultId) {
return success(equFaultDescriptionService.selectEquFaultDescriptionByFaultId(faultId));
AjaxResult ajaxResult = AjaxResult.success();
EquFaultDescription EquFaultDescriptionInfo= equFaultDescriptionService.selectEquFaultDescriptionByFaultId(faultId);
ajaxResult.put("info",EquFaultDescriptionInfo);
// List<String> arry = equFaultDescriptionService.selectFaultdesDictByfaultIds(faultId);
ajaxResult.put("dictValues", equFaultDescriptionService.selectFaultdesDictByfaultIds(faultId));
// return success(equFaultDescriptionService.selectEquFaultDescriptionByFaultId(faultId));
return ajaxResult;
}
/**

@ -93,6 +93,17 @@ public class EquFaultDescription extends BaseEntity {
// 创建日期结束
private String createTimeEnd;
/** 设备类型组 */
private String[] dictValues;
public String[] getDictValues() {
return dictValues;
}
public void setDictValues(String[] dictValues) {
this.dictValues = dictValues;
}
public void setFaultId(String faultId) {
this.faultId = faultId;
}

@ -0,0 +1,22 @@
package com.op.device.domain;
public class EquFaultdesDict {
private String faultId;
private String dictValue;
public String getFaultId() {
return faultId;
}
public void setFaultId(String faultId) {
this.faultId = faultId;
}
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
}

@ -23,6 +23,9 @@ public class EquOperation extends BaseEntity {
*/
private String id;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createTime;
/**
*
*/
@ -125,6 +128,11 @@ public class EquOperation extends BaseEntity {
@Excel(name = "工厂")
private String factoryCode;
/**
* 1
*/
@ -192,6 +200,16 @@ public class EquOperation extends BaseEntity {
private String poolName;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateTimeStart() {
return createTimeStart;
}

@ -2,6 +2,7 @@ package com.op.device.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import com.op.system.api.domain.SysDept;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -61,6 +62,30 @@ public class EquTeamUser extends BaseEntity {
@Excel(name = "手机号")
private String phonenumber;
private SysDept dept;
private Long deptId;
@Override
public Long getDeptId() {
return deptId;
}
@Override
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public SysDept getDept() {
return dept;
}
public void setDept(SysDept dept) {
this.dept = dept;
}
public void setId(String id) {
this.id = id;
}

@ -4,6 +4,7 @@ import java.util.List;
import com.op.device.domain.EquFaultDescription;
import com.op.device.domain.EquFaultType;
import com.op.device.domain.EquFaultdesDict;
/**
* Mapper
@ -63,4 +64,12 @@ public interface EquFaultDescriptionMapper {
int selectSerialNumber();
List<EquFaultDescription> selectFaultDescriptionList(EquFaultDescription equFaultDescription);
void deleteFaultdesDictByfaultId(String faultId);
void batchFaultdesDict(List<EquFaultdesDict> list);
void deleteFaultdesDictByfaultIds(String[] faultIds);
List<String> selectFaultdesDictByfaultId(String faultId);
}

@ -1,6 +1,7 @@
package com.op.device.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquOperation;
@ -93,4 +94,6 @@ public interface EquOperationMapper {
* @return
*/
public EquOperation selectEquipmentIntegrityRate(@Param("time") String time, @Param("equipmentCode") String equipmentCode);
String getInfoByUserName(String part);
}

@ -59,4 +59,6 @@ public interface IEquFaultDescriptionService {
* @return
*/
public int deleteEquFaultDescriptionByFaultId(String faultId);
List<String> selectFaultdesDictByfaultIds(String faultId);
}

@ -720,6 +720,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
return success("新增报修记录成功!");
} catch (Exception e) {
logger.error(e.getMessage());
return error();
}
}

@ -470,6 +470,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
EquOrder order = new EquOrder();
//源->目标
BeanUtils.copyProperties(plan, order);
order.setOrderId(IdUtils.fastSimpleUUID());
order.setCreateBy(createBy);
order.setCreateTime(nowtime);

@ -1,14 +1,17 @@
package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquFaultType;
import com.op.device.domain.EquFaultdesDict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquFaultDescriptionMapper;
@ -112,6 +115,7 @@ public class EquFaultDescriptionServiceImpl implements IEquFaultDescriptionServi
equFaultDescription.setUpdateBy(SecurityContextHolder.getUserName());
equFaultDescription.setUpdateTime(DateUtils.getNowDate());
equFaultDescriptionMapper.insertEquFaultDescription(equFaultDescription);
this.insertFaultdesDict(equFaultDescription);
return success("新增故障描述成功!");
}
@ -140,9 +144,35 @@ public class EquFaultDescriptionServiceImpl implements IEquFaultDescriptionServi
equFaultDescription.setUpdateTime(DateUtils.getNowDate());
// 插入数据库
equFaultDescriptionMapper.updateEquFaultDescription(equFaultDescription);
String faultId = equFaultDescription.getFaultId();
// 删除关联
equFaultDescriptionMapper.deleteFaultdesDictByfaultId(faultId);
// 新增关联
insertFaultdesDict(equFaultDescription);
return success("修改成功!");
}
public void insertFaultdesDict(EquFaultDescription equFaultDescription) {
this.insertFaultdesDict(equFaultDescription, equFaultDescription.getDictValues());
}
/**
*
*
* @param equFaultDescription
*/
public void insertFaultdesDict(EquFaultDescription equFaultDescription,String[] dictValues) {
if (StringUtils.isNotEmpty(dictValues)) {
// 新增用户与岗位管理
List<EquFaultdesDict> list = new ArrayList<EquFaultdesDict>();
for (String dictValue : dictValues) {
EquFaultdesDict up = new EquFaultdesDict();
up.setFaultId(equFaultDescription.getFaultId());
up.setDictValue(dictValue);
list.add(up);
}
equFaultDescriptionMapper.batchFaultdesDict(list);
}
}
/**
*
*
@ -152,6 +182,8 @@ public class EquFaultDescriptionServiceImpl implements IEquFaultDescriptionServi
@Override
@DS("#header.poolName")
public int deleteEquFaultDescriptionByFaultIds(String[] faultIds) {
// 删除用户与岗位关联
equFaultDescriptionMapper.deleteFaultdesDictByfaultIds(faultIds);
return equFaultDescriptionMapper.deleteEquFaultDescriptionByFaultIds(faultIds);
}
@ -164,6 +196,13 @@ public class EquFaultDescriptionServiceImpl implements IEquFaultDescriptionServi
@Override
@DS("#header.poolName")
public int deleteEquFaultDescriptionByFaultId(String faultId) {
equFaultDescriptionMapper.deleteFaultdesDictByfaultId(faultId);
return equFaultDescriptionMapper.deleteEquFaultDescriptionByFaultId(faultId);
}
@Override
@DS("#header.poolName")
public List<String> selectFaultdesDictByfaultIds(String faultId) {
return equFaultDescriptionMapper.selectFaultdesDictByfaultId(faultId);
}
}

@ -5,6 +5,7 @@ import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
@ -56,7 +57,21 @@ public class EquOperationServiceImpl implements IEquOperationService {
equOperation.setCreateTimeEnd(formatter.format(equOperation.getCreateTimeArray().get(1)));
}
}
return equOperationMapper.selectEquOperationList(equOperation);
List<EquOperation> operationList = equOperationMapper.selectEquOperationList(equOperation);
if (operationList != null && operationList.size() > 0){
for (EquOperation operation:operationList) {
if (operation.getRepairPerson() != null){
String[] parts = operation.getRepairPerson().split(";");
String names = "";
for (String part : parts) {
String name=equOperationMapper.getInfoByUserName(part);
names = names+name+";";
}
operation.setRepairPerson(names);
}
}
}
return operationList;
}
/**

@ -519,24 +519,24 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
String GZCS = equOperation.getHandlingMethod();//维修措施
String WXR = equOperation.getRepairPerson();//维修人
if (GZMS != null) {
equOperation.setFailureDescription(GZMS + formattedDate + ":" + equRepairWorkOrder.getWorkFaultDesc() + ";");
equOperation.setFailureDescription(GZMS + equRepairWorkOrder.getWorkFaultDesc() + ";");
} else {
equOperation.setFailureDescription(formattedDate + ":" + equRepairWorkOrder.getWorkFaultDesc() + ";");
equOperation.setFailureDescription(equRepairWorkOrder.getWorkFaultDesc() + ";");
}
if (GZYY != null) {
equOperation.setReasonAnalyze(GZYY + formattedDate + ":" + equRepairWorkOrder.getWorkReason() + ";");
equOperation.setReasonAnalyze(GZYY + equRepairWorkOrder.getWorkReason() + ";");
} else {
equOperation.setReasonAnalyze(formattedDate + ":" + equRepairWorkOrder.getWorkReason() + ";");
equOperation.setReasonAnalyze(equRepairWorkOrder.getWorkReason() + ";");
}
if (GZCS != null) {
equOperation.setHandlingMethod(GZCS + formattedDate + ":" + equRepairWorkOrder.getRepairMeasures() + ";");
equOperation.setHandlingMethod(GZCS + equRepairWorkOrder.getRepairMeasures() + ";");
} else {
equOperation.setHandlingMethod(formattedDate + ":" + equRepairWorkOrder.getRepairMeasures() + ";");
equOperation.setHandlingMethod(equRepairWorkOrder.getRepairMeasures() + ";");
}
if (WXR != null) {
equOperation.setRepairPerson(WXR + formattedDate + ":" + equRepairWorkOrder.getWorkPerson() + ";");
equOperation.setRepairPerson(WXR + equRepairWorkOrder.getWorkPerson() + ";");
} else {
equOperation.setRepairPerson(formattedDate + ":" + equRepairWorkOrder.getWorkPerson() + ";");
equOperation.setRepairPerson(equRepairWorkOrder.getWorkPerson() + ";");
}
}
//当获取的设备运行记录为空的时候,代表没有生成,这块让上位机卡住 todo

@ -7,6 +7,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.datascope.annotation.DataScope;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquTeamUser;
import com.op.device.mapper.EquTeamUserMapper;
@ -188,6 +189,7 @@ public class EquTeamServiceImpl implements IEquTeamService {
@Override
@DS("#master")
public List<EquTeamUser> selectTeamMembers(EquTeamUser equTeamUser) {
return equTeamMapper.selectTeamMembers(equTeamUser);
List<EquTeamUser> equTeamUserList =equTeamMapper.selectTeamMembers(equTeamUser);
return equTeamUserList;
}
}

@ -91,6 +91,12 @@
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="batchFaultdesDict">
insert into equ_faultdes_dict(fault_id, dict_value) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.faultId},#{item.dictValue})
</foreach>
</insert>
<update id="updateEquFaultDescription" parameterType="EquFaultDescription">
update equ_fault_description
@ -122,10 +128,27 @@
#{faultId}
</foreach>
</delete>
<delete id="deleteFaultdesDictByfaultId" parameterType="String">
delete from equ_faultdes_dict where fault_id=#{faultId}
</delete>
<delete id="deleteFaultdesDictByfaultIds" parameterType="String">
delete from equ_faultdes_dict where fault_id in
<foreach collection="array" item="faultId" open="(" separator="," close=")">
#{faultId}
</foreach>
</delete>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(fault_id)+1 AS serialNum
FROM equ_fault_description
WHERE del_flag = '0'
</select>
<select id="selectFaultdesDictByfaultId" resultType="java.lang.String">
select up.dict_value
from equ_fault_description p
left join equ_faultdes_dict up on up.fault_id = p.fault_id
where p.fault_id = #{faultId}
</select>
</mapper>

@ -85,7 +85,7 @@
</if>
<if test="reasonAnalyze != null and reasonAnalyze != ''">and reason_analyze = #{reasonAnalyze}</if>
<if test="handlingMethod != null and handlingMethod != ''">and handling_method = #{handlingMethod}</if>
<if test="repairPerson != null and repairPerson != ''">and repair_person concat('%', #{repairPerson},
<if test="repairPerson != null and repairPerson != ''">and repair_person like concat('%', #{repairPerson},
'%')
</if>
<if test="equStatusDes != null and equStatusDes != ''">and equ_status_des = #{equStatusDes}</if>
@ -279,5 +279,7 @@
and equipment_code = #{equipmentCode}
and del_flag = '0'
</select>
<select id="getInfoByUserName" resultType="java.lang.String" parameterType="java.lang.String">
SELECT nick_name from lanju_op_cloud.dbo.sys_user where user_name = #{part} and del_flag =0
</select>
</mapper>

@ -115,7 +115,7 @@
<include refid="selectEquRepairOrderVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and order_code like concat('%', #{orderCode}, '%')</if>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%',#{equipmentCode}, '%')</if>
<if test="equipmentCode != null and equipmentCode != ''">and ero.equipment_code like concat('%',#{equipmentCode}, '%')</if>
<if test="orderDesc != null and orderDesc != ''">and order_desc like concat('%', #{orderDesc}, '%')</if>
<!--故障开始时间 结束时间-->
<if test="orderBreakdownTimeStart != null ">and CONVERT(date,order_breakdown_time) >= #{orderBreakdownTimeStart}</if>
@ -389,7 +389,7 @@
LEFT JOIN base_equipment B ON A.equipment_code = B.equipment_code
WHERE
A.auxiliary_equipment_code = #{equipmentCode}
AND A.del_flag='0'
</select>
<select id="selectRepairEquList" resultType="java.util.Map">
SELECT

@ -120,13 +120,13 @@
</select>
<select id="selectTeamMembers" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
select
user_id AS userId,
user_name AS userName,
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where del_flag = '0'
select
user_id AS userId,
user_name AS userName,
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where del_flag = '0'
</select>
<select id="selectTeamMember" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">

@ -26,7 +26,7 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -7,14 +7,10 @@ import java.util.Map;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.core.utils.poi.ExcelMesDayEffMapUtil;
import com.op.mes.domain.MesLineAssistant;
import com.op.mes.domain.vo.DynamicColumnVo;
import com.op.mes.domain.vo.MesDailyEfficiencyVo;
import com.op.mes.domain.vo.MesLineAssistantQtyVo;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -26,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesLineAssistantQty;
import com.op.mes.service.IMesLineAssistantQtyService;
import com.op.common.core.web.controller.BaseController;

@ -750,7 +750,7 @@ public class MesReportWorkController extends BaseController {
/**批次预报工数据**/
@PostMapping("/preReportRow")
public AjaxResult preReportRow(@RequestBody MesReportWork mesReportWork) {
public AjaxResult preReportRow(@RequestBody MesReportWork mesReportWork) throws Exception {
R r = mesReportWorkService.preReportRow(mesReportWork);
if(r.getCode()==200){
return AjaxResult.success();

@ -29,6 +29,7 @@ public class MesReportWork extends BaseEntity {
@Excel(name = "生产工单编码")
private String workorderCode;
/** SAP订单号 */
@Excel(name = "SAP订单号")
private String workorderCodeSap;

@ -120,4 +120,6 @@ public interface MesMapper {
Map getProductionNumberPLC(BoardDTO mesBoard);
List<String> getproductLineList();
}

@ -135,7 +135,7 @@ public interface IMesReportWorkService {
int deleteReportNow(String reportCode);
R preReportRow(MesReportWork mesReportWork);
R preReportRow(MesReportWork mesReportWork) throws Exception;
List<MesDailyReportVo> getDailyReportNew(MesDailyReportVo mesDailyReportVo);
List<MesDailyReportVo> getDailyReportExportNew(MesDailyReportVo mesDailyReportVo);

@ -43,7 +43,7 @@ public interface IWCSInterfaceService {
AjaxResult changeTransferResultTask();
R prReportWork(MesReportWork mesReportWork);
R prReportWork(MesReportWork mesReportWork) throws Exception;
Map getWhiteBoardEquPro7Days(BoardDTO boardDTO);

@ -38,6 +38,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -580,15 +581,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
}
return sapRson;
}finally {
} catch (Exception e) {
return R.fail("报工失败:"+e.getMessage());
} finally {
DynamicDataSourceContextHolder.poll();
}
}
@Override
public R prReportWork(MesReportWork mesReportWork) {
public R prReportWork(MesReportWork mesReportWork) throws Exception {
//根据belong_work_order找到sap工单(子子母)
List<MesReportWork> workOrders = mesReportWorkMapper.getSapWorkOrderByReport(mesReportWork.getReportCode());
@ -808,7 +810,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
* @param workOrder
* @return
*/
private R reportHzToSap(MesReportWork workOrder) {
private R reportHzToSap(MesReportWork workOrder) throws Exception {
Date nowTime = DateUtils.getNowDate();
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
@ -847,6 +849,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
sapRFW.setLt_hwList(lt_hwList);
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
String productDate = workOrder.getProductDate().replace("-", "");
sapRFW.setBudat(productDate);
sapRFW.setRemark(workOrder.getRemark());//备注
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工请求" + JSONObject.toJSONString(sapRFW));
R r = remoteSapService.sapRFWOrder(sapRFW);
@ -872,7 +876,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
* @param workOrder
* @return
*/
private R reportHzToSap3(MesReportWork workOrder) {
private R reportHzToSap3(MesReportWork workOrder) throws Exception {
Date nowTime = DateUtils.getNowDate();
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
@ -909,6 +913,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
sapRFW.setLt_hwList(lt_hwList);
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
String productDate = workOrder.getProductDate().replace("-", "");
sapRFW.setBudat(productDate);
sapRFW.setRemark(workOrder.getRemark());//备注
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工请求" + JSONObject.toJSONString(sapRFW));
//R r= R.ok();
@ -935,7 +941,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
* @param workOrder
* @return
*/
private R preReportToSap(MesReportWork workOrder) {
private R preReportToSap(MesReportWork workOrder) throws Exception {
Date nowTime = DateUtils.getNowDate();
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
@ -967,6 +973,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
// }
sapRFW.setLt_hwList(lt_hwList);
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
String productDate = workOrder.getProductDate().replace("-", "");
sapRFW.setBudat(productDate);
sapRFW.setRemark(workOrder.getRemark());//备注
logger.info(workOrder.getWorkorderCodeSap() + "sap工单预报工请求" + JSONObject.toJSONString(sapRFW));
R r = remoteSapService.sapRFWOrder(sapRFW);
@ -1310,18 +1318,18 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
public static void main(String args[]){
List<String> days = new ArrayList<>();
// 获取当前日期
LocalDate today = LocalDate.now();
// 定义一个日期格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 打印最近七天的日期
for (int i = 0; i < 7; i++) {
LocalDate date = today.minusDays(i);
days.add(date.format(formatter));
}
Collections.reverse(days);
System.out.println(days);
}
// public static void main(String args[]){
// List<String> days = new ArrayList<>();
// // 获取当前日期
// LocalDate today = LocalDate.now();
// // 定义一个日期格式化器
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// // 打印最近七天的日期
// for (int i = 0; i < 7; i++) {
// LocalDate date = today.minusDays(i);
// days.add(date.format(formatter));
// }
// Collections.reverse(days);
// System.out.println(days);
// }
}

@ -55,6 +55,15 @@ public class MesBoradServiceImpl implements IMesBoradService {
try {
boardDTO.setEquipmentTypeCode("equ_type_bzx");
List<BoardDTO> lineList = mesMapper.getLineList(boardDTO);
if (boardDTO.getIsqua()!=null){
//查询当天生产的产线
List<String> productLineList = mesMapper.getproductLineList();
// 使用Stream过滤lineList只保留equCode在productLineList中的数据
lineList = lineList.stream()
.filter(item -> productLineList.contains(item.getEquCode()))
.collect(Collectors.toList());
}
return lineList;
}finally {
DynamicDataSourceContextHolder.poll();
@ -65,157 +74,180 @@ public class MesBoradServiceImpl implements IMesBoradService {
@Override
public BoardDTO getProduction15Days(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
BoardDTO dto = new BoardDTO();
try {
BoardDTO dto = new BoardDTO();
String nowDate = DateUtils.getDate();
String nowDate = DateUtils.getDate();
List<String> days = this.getDays(15);
//days
dto.setDays(days);
boardDTO.setStartTime(days.get(0));
boardDTO.setEndTime(days.get(days.size()-1));
Map<String,MesReportWork> pros15Plan = mesMapper.getProduction15Days(boardDTO);
Map<String,MesReportWork> pros15Act = mesMapper.getProduction15DaysAct(boardDTO);
MesReportWork todayPlandto = pros15Plan.get(nowDate);
MesReportWork todayActdto = pros15Act.get(nowDate);
if(todayPlandto != null){
dto.setPlanProduction(todayPlandto.getQuantity().toString().replace(".00",""));
}else{
dto.setPlanProduction("0");
}
if(todayActdto != null){
dto.setActProduction(todayActdto.getQuantityFeedback().toString().replace(".00",""));
}else{
dto.setActProduction("0");
}
//plans;
List<String> plans = new ArrayList<>();
List<String> acts = new ArrayList<>();
//acts;
for(String dayStr:days){
MesReportWork workPlanR = pros15Plan.get(dayStr);
MesReportWork workActR = pros15Act.get(dayStr);
if(workPlanR != null){
plans.add(workPlanR.getQuantity().toString());
List<String> days = this.getDays(15);
//days
dto.setDays(days);
boardDTO.setStartTime(days.get(0));
boardDTO.setEndTime(days.get(days.size()-1));
Map<String,MesReportWork> pros15Plan = mesMapper.getProduction15Days(boardDTO);
Map<String,MesReportWork> pros15Act = mesMapper.getProduction15DaysAct(boardDTO);
MesReportWork todayPlandto = pros15Plan.get(nowDate);
MesReportWork todayActdto = pros15Act.get(nowDate);
if(todayPlandto != null){
dto.setPlanProduction(todayPlandto.getQuantity().toString().replace(".00",""));
}else{
plans.add("0");
dto.setPlanProduction("0");
}
if(workActR != null){
acts.add(workActR.getQuantityFeedback().toString());
if(todayActdto != null){
dto.setActProduction(todayActdto.getQuantityFeedback().toString().replace(".00",""));
}else{
acts.add("0");
dto.setActProduction("0");
}
//plans;
List<String> plans = new ArrayList<>();
List<String> acts = new ArrayList<>();
//acts;
for(String dayStr:days){
MesReportWork workPlanR = pros15Plan.get(dayStr);
MesReportWork workActR = pros15Act.get(dayStr);
if(workPlanR != null){
plans.add(workPlanR.getQuantity().toString());
}else{
plans.add("0");
}
if(workActR != null){
acts.add(workActR.getQuantityFeedback().toString());
}else{
acts.add("0");
}
}
dto.setPlans(plans);
dto.setActs(acts);
return dto;
}finally {
DynamicDataSourceContextHolder.poll();
}
dto.setPlans(plans);
dto.setActs(acts);
return dto;
}
@Override
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
Map<String,BoardDTO> dtoMap = new HashMap<>();
//当前工单信息
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
try {
Map<String,BoardDTO> dtoMap = new HashMap<>();
//当前工单信息
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
if(workOrder == null || StringUtils.isEmpty(workOrder.getWorkorderCode())){
return dtoMap;
}
boardDTO.setWorkorderCode(workOrder.getWorkorderCode());
boardDTO.setProductCode(workOrder.getProductCode());
MesLine meslineInfo = mesMapper.getMesLineInfo(boardDTO);
QuantityDto quantityDto = new QuantityDto();
quantityDto.setWorkorderCode(boardDTO.getWorkorderCode());
quantityDto.setMachineCode(boardDTO.getEquCode());
quantityDto.setBoard("1");
QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto);
QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto);
if(sonMesReport == null){//单层工单的情况
sonMesReport = mesReportWorkMapper.getSumQuantityOne(quantityDto);
}
if(sonMesReport != null){//实际用人
workOrder.setActMan(sonMesReport.getUseMan());
}else{
workOrder.setActMan(new BigDecimal("0"));
}
if(parentMesReport!=null){//实际效率 = 实际母单产量/子总工时
BigDecimal manAvgActual = new BigDecimal(parentMesReport.getQuantityFeedbackSum())
.divide(sonMesReport.getWorkTime(),2,BigDecimal.ROUND_HALF_UP);
workOrder.setActXl(manAvgActual);
}else{
workOrder.setActXl(new BigDecimal("0"));
}
if(meslineInfo != null){
workOrder.setStandarMan(meslineInfo.getStandarMan());
workOrder.setStandarXl(meslineInfo.getStandarXl());
}else{
workOrder.setStandarMan(new BigDecimal("0"));
workOrder.setStandarXl(new BigDecimal("0"));
}
dtoMap.put("workOrder",workOrder);
QcCheckTaskDTO taskDTO = mesMapper.getTaskInfo(boardDTO);
BoardDTO task2 = new BoardDTO();
if(taskDTO.getQuality() != null){
task2.setTaskNum(taskDTO.getQuality().toString());
}else{
task2.setTaskNum("0");
}
dtoMap.put("taskNum",task2);//巡检次数
BoardDTO task3 = new BoardDTO();
if(taskDTO.getSampleQuality() != null){
task3.setTaskSampleNum(taskDTO.getSampleQuality().toString());
}else{
task3.setTaskSampleNum("0");
}
dtoMap.put("taskSampleNum",task3);//巡检抽样数量
BoardDTO task4 = new BoardDTO();
List<QcCheckTaskDTO> checkList = mesMapper.getCheckList(boardDTO);
if(!CollectionUtils.isEmpty(checkList)){
task4.setCheckList(checkList);
}
dtoMap.put("piedata",task4);//巡检结果
if(workOrder == null || StringUtils.isEmpty(workOrder.getWorkorderCode())){
return dtoMap;
}finally {
DynamicDataSourceContextHolder.poll();
}
boardDTO.setWorkorderCode(workOrder.getWorkorderCode());
boardDTO.setProductCode(workOrder.getProductCode());
MesLine meslineInfo = mesMapper.getMesLineInfo(boardDTO);
QuantityDto quantityDto = new QuantityDto();
quantityDto.setWorkorderCode(boardDTO.getWorkorderCode());
quantityDto.setMachineCode(boardDTO.getEquCode());
quantityDto.setBoard("1");
QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto);
QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto);
if(sonMesReport == null){//单层工单的情况
sonMesReport = mesReportWorkMapper.getSumQuantityOne(quantityDto);
}
if(sonMesReport != null){//实际用人
workOrder.setActMan(sonMesReport.getUseMan());
}else{
workOrder.setActMan(new BigDecimal("0"));
}
if(parentMesReport!=null){//实际效率 = 实际母单产量/子总工时
BigDecimal manAvgActual = new BigDecimal(parentMesReport.getQuantityFeedbackSum())
.divide(sonMesReport.getWorkTime(),2,BigDecimal.ROUND_HALF_UP);
workOrder.setActXl(manAvgActual);
}else{
workOrder.setActXl(new BigDecimal("0"));
}
if(meslineInfo != null){
workOrder.setStandarMan(meslineInfo.getStandarMan());
workOrder.setStandarXl(meslineInfo.getStandarXl());
}else{
workOrder.setStandarMan(new BigDecimal("0"));
workOrder.setStandarXl(new BigDecimal("0"));
}
dtoMap.put("workOrder",workOrder);
QcCheckTaskDTO taskDTO = mesMapper.getTaskInfo(boardDTO);
BoardDTO task2 = new BoardDTO();
if(taskDTO.getQuality() != null){
task2.setTaskNum(taskDTO.getQuality().toString());
}else{
task2.setTaskNum("0");
}
dtoMap.put("taskNum",task2);//巡检次数
BoardDTO task3 = new BoardDTO();
if(taskDTO.getSampleQuality() != null){
task3.setTaskSampleNum(taskDTO.getSampleQuality().toString());
}else{
task3.setTaskSampleNum("0");
}
dtoMap.put("taskSampleNum",task3);//巡检抽样数量
BoardDTO task4 = new BoardDTO();
List<QcCheckTaskDTO> checkList = mesMapper.getCheckList(boardDTO);
if(!CollectionUtils.isEmpty(checkList)){
task4.setCheckList(checkList);
}
dtoMap.put("piedata",task4);//巡检结果
return dtoMap;
}
@Override
public List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<ProOrderWorkorder> dtos = mesMapper.getPorOrderList(boardDTO);
return dtos;
try{
List<ProOrderWorkorder> dtos = mesMapper.getPorOrderList(boardDTO);
return dtos;
}finally {
DynamicDataSourceContextHolder.poll();
}
}
@Override
public List<BoardDTO> getHFProInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFProInfo(boardDTO);
return dtos;
try {
List<BoardDTO> dtos = mesMapper.getHFProInfo(boardDTO);
return dtos;
}finally {
DynamicDataSourceContextHolder.poll();
}
}
@Override
public List<BoardDTO> getHFQcInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFQcInfo(boardDTO);
// if(!CollectionUtils.isEmpty(dtos)){
// //不合格
// List<BoardDTO> isquas = dtos.stream().filter(a -> a.getIsqua().equals("0")).collect(Collectors.toList());
// dtos.get(0).setTaskNum(isquas.size()+"");
// }
return dtos;
try {
List<BoardDTO> dtos = mesMapper.getHFQcInfo(boardDTO);
return dtos;
}finally {
DynamicDataSourceContextHolder.poll();
}
}
@Override
public List<BoardDTO> getHFxlInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<BoardDTO> dtos = mesMapper.getHFxlInfo(boardDTO);
return dtos;
try {
List<BoardDTO> dtos = mesMapper.getHFxlInfo(boardDTO);
return dtos;
}finally {
DynamicDataSourceContextHolder.poll();
}
}
@ -240,24 +272,12 @@ public class MesBoradServiceImpl implements IMesBoradService {
@Override
public Map getProductionNumberPLC(BoardDTO mesBoard) {
DynamicDataSourceContextHolder.push(mesBoard.getFactoryCode());
Map mapList = mesMapper.getProductionNumberPLC(mesBoard);
return mapList;
}
public static void main(String[] args){
List<String> days = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号
Date date = new Date();
for(int num=0;num<15;num++){
cal.setTime(date);
cal.add(Calendar.DAY_OF_MONTH, -num);
days.add(sdf.format(cal.getTime()));
try {
Map mapList = mesMapper.getProductionNumberPLC(mesBoard);
return mapList;
}finally {
DynamicDataSourceContextHolder.poll();
}
Collections.reverse(days);
System.out.println(JSONObject.toJSONString(days));
}
}

@ -839,7 +839,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@Override
@DS("#header.poolName")
public R preReportRow(MesReportWork mesReportWork) {
public R preReportRow(MesReportWork mesReportWork) throws Exception {
mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName"));
R s = iWCSInterfaceService.prReportWork(mesReportWork);
return s;

@ -15,7 +15,7 @@ spring:
discovery:
#命名空间
namespace: lanju-op-test
group: test
group: ywl
# 服务注册地址
server-addr: 192.168.202.20:8848
config:

@ -387,7 +387,7 @@
and del_flag = '0'
group by workorder_code,batch
)t on t0.workorderCode = t.workorder_code and t0.batchCode = t.batch
order by t0.batchCode
order by t0.workorderCodeSap ASC,t0.batchCode
</select>
<select id="getHFProInfo" resultType="com.op.system.api.domain.dto.BoardDTO">
select t.*,isnull(be.unit_working_hours,0) unitPro from
@ -543,6 +543,14 @@
line_code =#{ equCode }
AND workorder_code =#{ workorderCode}
</select>
<select id="getproductLineList" resultType="java.lang.String">
SELECT DISTINCT
workorder_name
FROM
pro_order_workorder
WHERE
product_date = CONVERT ( VARCHAR ( 10 ), GETDATE( ), 120 )
</select>
</mapper>

@ -711,6 +711,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select
ow.workorder_code workorderCode,
ow.workorder_code_sap workorderCodeSap,
ow.product_date productDate,
mrw.quantity_feedback quantityFeedback,
mrw.product_code productCode,
mrw.product_name productName,

@ -26,8 +26,7 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -28,7 +28,6 @@
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="atrr2" column="atrr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="createBy" column="create_by"/>
@ -107,10 +106,17 @@
pow.route_code, pow.prod_line_code, pow.product_date,
pow.shift_id, pow.parent_order,pow.status, pow.prod_type,pow.factory_code,
pow.end_flag,pow.car_num,pow.sort_no,
pow.workorder_code_sap,po.atrr2,be.sap_code,be.sap_name
pow.workorder_code_sap,po.atrr2,be.sap_code,be.sap_name,
REPLACE(FORMAT(bp.length, '0.########'), '.', '') + '×' +
REPLACE(FORMAT(bp.width, '0.########'), '.', '') + '×' +
REPLACE(FORMAT(bp.height, '0.########'), '.', '') AS attr4,
sda.dict_label AS attr3
from pro_order_workorder pow
left join pro_order po on pow.order_id = po.id
left join base_equipment be on pow.workorder_name=be.equipment_code
left join base_product bp on pow.product_code=bp.product_code
LEFT JOIN base_product_attached bpa ON RIGHT(bp.product_code, 11) = bpa.product_code
LEFT JOIN lanju_op_cloud.dbo.sys_dict_data sda ON bpa.pack_type = sda.dict_value and sda.dict_type = 'pack_type'
<where>
<if test="workorderCode != null and workorderCode != ''">and pow.workorder_code like concat('%',
#{workorderCode}, '%')

@ -0,0 +1,15 @@
<?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>op-modules</artifactId>
<groupId>com.op</groupId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>op-printservice</artifactId>
</project>

@ -26,8 +26,7 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -168,7 +168,7 @@ public class QcCheckTaskIncomeController extends BaseController {
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("检验项目", "ruleName", 30));
excelCols.add(new ExcelCol("标准要求", "checkStandard", 30));
excelCols.add(new ExcelCol("抽检数", "samplePlan", 30));
excelCols.add(new ExcelCol("抽检数", "sampleQuality", 30));
excelCols.add(new ExcelCol("实测结果", "actualValue", 30));
excelCols.add(new ExcelCol("判定", "status", 30));
excelCols.add(new ExcelCol("附件", "fileUrls", 30));

@ -0,0 +1,29 @@
package com.op.quality.controller;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.service.QcCheckWechartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
*
* @author YangWANLI
* @date 2025-04-19
*/
@RestController
@RequestMapping("/qualityWechart")
public class QcCheckWechartController extends BaseController {
@Autowired
private QcCheckWechartService qcCheckWechartService;
//查询前一天包材、成品质检信息
@GetMapping("/qualityCheckInfoByday")
public AjaxResult qualityCheckInfoByday() {
return AjaxResult.success(qcCheckWechartService.qualityCheckInfoByday());
}
}

@ -0,0 +1,10 @@
package com.op.quality.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
@Mapper
public interface QcCheckWechartMapper {
Map qualityCheckInfoByday();
}

@ -0,0 +1,8 @@
package com.op.quality.service;
import java.util.Map;
public interface QcCheckWechartService {
Map qualityCheckInfoByday();
}

@ -75,12 +75,16 @@ public class QcCheckSampleTaskServiceImpl implements IQcCheckSampleTaskService {
public AjaxResult createCheckSampleTask() {
// 这是数据源的key
DynamicDataSourceContextHolder.push("ds_1000");
List<QcCheckSampleTask> list = qcCheckSampleTaskMapper.selectScTaskListByDay();
if (!CollectionUtils.isEmpty(list)) {
for (QcCheckSampleTask item : list) {
item.setId(IdUtils.fastSimpleUUID());
try {
List<QcCheckSampleTask> list = qcCheckSampleTaskMapper.selectScTaskListByDay();
if (!CollectionUtils.isEmpty(list)) {
for (QcCheckSampleTask item : list) {
item.setId(IdUtils.fastSimpleUUID());
}
qcCheckSampleTaskMapper.batchInsertQcCheckSampleTask(list);
}
qcCheckSampleTaskMapper.batchInsertQcCheckSampleTask(list);
}finally {
DynamicDataSourceContextHolder.poll();
}
return success();
}

@ -1447,6 +1447,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
mapdto.put("ruleName",detail.getRuleName());
mapdto.put("checkStandard",detail.getCheckStandard());
mapdto.put("actualValue",detail.getActualValue());
mapdto.put("sampleQuality",detail.getSampleQuality());
if("Y".equals(detail.getStatus())){
mapdto.put("status","合格");
}else if("N".equals(detail.getStatus())){

@ -0,0 +1,77 @@
package com.op.quality.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.quality.mapper.QcCheckWechartMapper;
import com.op.quality.service.QcCheckWechartService;
import com.op.system.api.RemoteOpenService;
import com.op.system.api.domain.SysNoticeGroup;
import com.op.system.api.domain.dto.WechartDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class QcCheckWechartServiceImpl implements QcCheckWechartService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private QcCheckWechartMapper qcCheckWechartMapper;
@Autowired
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
@Autowired
private RemoteOpenService remoteOpenService;
@Override
@DS("#header.poolName")
public Map qualityCheckInfoByday() {
// Map<String,String> map=qcCheckWechartMapper.qualityCheckInfoByday();
Map<String, Object> map = qcCheckWechartMapper.qualityCheckInfoByday();
map.replaceAll((key, value) -> {
if (value instanceof Number) {
return String.valueOf(value);
}
return value; // 非数字类型保留原值
});
SysNoticeGroup noticeQo = new SysNoticeGroup();
if(map != null){
noticeQo.setNoticeId(25L);
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
System.out.println(notices);
sendWeChartMessage(noticeQo,map);
}
return map;
}
private void sendWeChartMessage(SysNoticeGroup noticeQo,Map map){
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
if(!CollectionUtils.isEmpty(notices) && notices.size() > 0) {
List<WechartDTO> wecharts = new ArrayList<>();
for (SysNoticeGroup noticedto : notices) {
WechartDTO wechart0 = new WechartDTO();
wechart0.setUserId(noticedto.getWxId());
String contentInfo = notices.get(0).getNoticeContent();
String message=StringUtils.format(contentInfo,map);
wechart0.setText(message);
wecharts.add(wechart0);
}
// logger.info("任务编号为:"+ checkNoList + "的"+ message + ",企业微信二次提醒请求:" + JSONObject.toJSONString(wecharts));
if (!CollectionUtils.isEmpty(wecharts)) {
new Thread(() -> {
AjaxResult result = remoteOpenService.sendWeChartMessage(wecharts);
logger.info("企业微信发送质检情况:" + JSONObject.toJSONString(result));
}).start();
}
}
}
}

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcCheckWechartMapper">
<select id="qualityCheckInfoByday" resultType="java.util.Map">
SELECT * FROM check_view
</select>
</mapper>

@ -294,6 +294,8 @@ public class SapOrderServiceImpl implements SapOrderService {
jCoParameterList.setValue("P_ANZMA", sapRFW.getAnzma());
//备注
jCoParameterList.setValue("P_TEXT", sapRFW.getRemark());
//记账日期格式为YYYYMMDD
jCoParameterList.setValue("P_BUDAT", sapRFW.getBudat());
if (sapRFW.getLt_gs() == null) {
return R.fail("生产订单报工工时为空");
}

@ -26,8 +26,7 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -27,7 +27,7 @@ if exist %df% (
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo FROM openjdk:8u131-jdk >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

Loading…
Cancel
Save