This commit is contained in:
parent
29033c0cfa
commit
21ff5d73e9
|
|
@ -29,6 +29,12 @@ public class MaType extends BaseEntity {
|
|||
@ApiModelProperty(value = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "退料ID")
|
||||
private Long backId;
|
||||
|
||||
@ApiModelProperty(value = "是否完成退料")
|
||||
private String isFinished;
|
||||
|
||||
/** 类型名称 */
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
@Excel(name = "名称")
|
||||
|
|
|
|||
|
|
@ -61,11 +61,14 @@ public class TokenController {
|
|||
// 用户登录
|
||||
LoginUser userInfo = sysLoginService.login(form.getUsername(), decryptedData);
|
||||
String uuid = form.getUuid();
|
||||
String captcha = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid).toString();
|
||||
if (StringUtils.isBlank(captcha)) {
|
||||
Object object = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
||||
String captcha = "";
|
||||
if (object == null) {
|
||||
// 删除验证码缓存
|
||||
redisService.deleteObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
||||
return R.fail("验证码超时,请重新刷新");
|
||||
return R.fail("图形验证码超时,请重新刷新");
|
||||
} else {
|
||||
captcha = object.toString();
|
||||
}
|
||||
if (form.getCode() != null && form.getCode().equals(captcha)) {
|
||||
// 删除验证码缓存
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ public class SysLoginService {
|
|||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||
}
|
||||
// 判断密码是否为原始密码,原始密码需要修改密码方可登录
|
||||
if (passwordService.checkFirstLogin(user, password)) {
|
||||
/*if (passwordService.checkFirstLogin(user, password)) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录密码为系统默认密码,请修改密码后重新登录");
|
||||
throw new ServiceException("登录密码为系统默认密码,请修改密码后重新登录");
|
||||
}
|
||||
}*/
|
||||
passwordService.validate(user, password);
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
||||
return userInfo;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.bonus.sgzb.auth.service;
|
|||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.bonus.sgzb.common.core.domain.SystemConfig;
|
||||
import com.bonus.sgzb.auth.utils.SystemConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.bonus.sgzb.common.core.constant.CacheConstants;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.sgzb.common.core.domain;
|
||||
package com.bonus.sgzb.auth.utils;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
|
@ -11,7 +11,6 @@ import java.util.List;
|
|||
* @Author ma_sh
|
||||
* @create 2025/4/17 14:11
|
||||
*/
|
||||
@RefreshScope
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "system-config")
|
||||
@Data
|
||||
|
|
@ -163,17 +163,17 @@ public class PoiOutPage {
|
|||
*
|
||||
* @param result 数据内容(每行是一个 Map)
|
||||
* @param list 表头
|
||||
* @param filename 文件名
|
||||
* @param fileName 文件名
|
||||
* @param unit 单位信息
|
||||
* @param projectName 项目名称
|
||||
* @return HSSFWorkbook 生成的 Excel 文件
|
||||
*/
|
||||
public static HSSFWorkbook excelForCheck(List<Map<String, Object>> result, List<String> list,
|
||||
String filename, String unit, String projectName) {
|
||||
String fileName, String unit, String projectName, String type) {
|
||||
// 创建工作簿和工作表
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
HSSFSheet sheet = workbook.createSheet();
|
||||
sheet.setDefaultColumnWidth(15); // 设置列宽
|
||||
sheet.setDefaultColumnWidth(16); // 设置列宽
|
||||
|
||||
// 创建样式
|
||||
HSSFCellStyle titleStyle = createTitleStyle(workbook);
|
||||
|
|
@ -181,12 +181,12 @@ public class PoiOutPage {
|
|||
HSSFCellStyle contentStyle = createCellStyle(workbook);
|
||||
|
||||
// 设置工作簿名称
|
||||
workbook.setSheetName(0, filename);
|
||||
workbook.setSheetName(0, fileName);
|
||||
|
||||
// 填充标题行
|
||||
int rowNum = 0;
|
||||
rowNum = createTitleRow(sheet, rowNum, filename, titleStyle, list.size());
|
||||
rowNum = createProjectInfoRow(sheet, rowNum, projectName, unit, titleStyle, list.size());
|
||||
rowNum = createTitleRow(sheet, rowNum, fileName, titleStyle, list.size());
|
||||
rowNum = createProjectInfoRow(sheet, rowNum, unit, projectName, type, titleStyle, list.size());
|
||||
|
||||
// 填充表头
|
||||
rowNum = createHeaderRow(sheet, rowNum, list, headerStyle);
|
||||
|
|
@ -196,9 +196,20 @@ public class PoiOutPage {
|
|||
rowNum = createDataRows(sheet, rowNum, result, contentStyle, list.size());
|
||||
} else {
|
||||
// 如果没有数据,则仅显示表头
|
||||
rowNum++;
|
||||
// rowNum++;
|
||||
// rowNum = createDataRows(sheet, rowNum, result, contentStyle, list.size());
|
||||
HSSFRow row = sheet.createRow(rowNum++);
|
||||
HSSFCell cell = row.createCell(0);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue("暂无数据");
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (list.size() - 1)));
|
||||
CellRangeAddress cellRange = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (list.size() - 1));
|
||||
// 设置边框样式
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet);
|
||||
}
|
||||
|
||||
return workbook;
|
||||
}
|
||||
|
||||
|
|
@ -218,22 +229,82 @@ public class PoiOutPage {
|
|||
/**
|
||||
* 创建项目名称和单位信息行
|
||||
*/
|
||||
private static int createProjectInfoRow(HSSFSheet sheet, int rowNum, String projectName, String unit,
|
||||
private static int createProjectInfoRow(HSSFSheet sheet, int rowNum, String unit, String projectName, String type,
|
||||
HSSFCellStyle titleStyle, int nColumn) {
|
||||
HSSFRow row = sheet.createRow(rowNum++);
|
||||
row.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (nColumn - 1)));
|
||||
HSSFCell cell = row.createCell(0);
|
||||
cell.setCellStyle(titleStyle);
|
||||
cell.setCellValue(projectName + " " + unit);
|
||||
|
||||
// 第一行:领料单位
|
||||
HSSFRow row1 = sheet.createRow(rowNum++);
|
||||
row1.setHeightInPoints(30);
|
||||
// bug修复:修改合并单元格区域,确保包含两个或以上单元格
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell1 = row1.createCell(0);
|
||||
cell1.setCellStyle(titleStyle);
|
||||
cell1.setCellValue("领料单位:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1)));
|
||||
HSSFCell cell2 = row1.createCell(2);
|
||||
cell2.setCellStyle(titleStyle);
|
||||
cell2.setCellValue(unit);
|
||||
|
||||
// 第二行:领料工程
|
||||
HSSFRow row2 = sheet.createRow(rowNum++);
|
||||
row2.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell3 = row2.createCell(0);
|
||||
cell3.setCellStyle(titleStyle);
|
||||
cell3.setCellValue("领料工程:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell4 = row2.createCell(2);
|
||||
cell4.setCellStyle(titleStyle);
|
||||
cell4.setCellValue(projectName);
|
||||
|
||||
// 第三行:设备类型
|
||||
HSSFRow row3 = sheet.createRow(rowNum++);
|
||||
row3.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell5 = row3.createCell(0);
|
||||
cell5.setCellStyle(titleStyle);
|
||||
cell5.setCellValue("设备类型:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell6 = row3.createCell(2);
|
||||
cell6.setCellStyle(titleStyle);
|
||||
cell6.setCellValue(type);
|
||||
|
||||
// 添加边框
|
||||
CellRangeAddress cellRange = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange1 = new CellRangeAddress(rowNum - 3, rowNum - 3, 0, 1);
|
||||
CellRangeAddress cellRange2 = new CellRangeAddress(rowNum - 3, rowNum - 3, 2, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange3 = new CellRangeAddress(rowNum - 2, rowNum - 2, 0, 1);
|
||||
CellRangeAddress cellRange4 = new CellRangeAddress(rowNum - 2, rowNum - 2, 2, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange5 = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1);
|
||||
CellRangeAddress cellRange6 = new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1));
|
||||
// 设置边框样式
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange6, sheet);
|
||||
|
||||
|
||||
return rowNum;
|
||||
}
|
||||
|
|
@ -390,7 +461,7 @@ public class PoiOutPage {
|
|||
// 创建工作簿和工作表
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
HSSFSheet sheet = workbook.createSheet();
|
||||
sheet.setDefaultColumnWidth(15); // 设置列宽
|
||||
sheet.setDefaultColumnWidth(16); // 设置列宽
|
||||
|
||||
// 创建样式
|
||||
HSSFCellStyle titleStyle = createTitleStyle(workbook);
|
||||
|
|
@ -402,7 +473,7 @@ public class PoiOutPage {
|
|||
|
||||
// 填充标题行
|
||||
int rowNum = 0;
|
||||
rowNum = createTitleRowStyle(sheet, rowNum, fileName, titleStyle, list.size());
|
||||
rowNum = createTitleRow(sheet, rowNum, fileName, titleStyle, list.size());
|
||||
rowNum = createProjectInfoRowOut(sheet, rowNum, projectName, unit, titleStyle, list.size(), code);
|
||||
|
||||
// 填充表头
|
||||
|
|
@ -433,21 +504,6 @@ public class PoiOutPage {
|
|||
|
||||
private static int createTotalRow(HSSFSheet sheet, int rowNum, List<String> list, String leasePerson, HSSFCellStyle headerStyle) {
|
||||
|
||||
/*HSSFRow row = sheet.createRow(rowNum++);
|
||||
HSSFCell cell = row.createCell(0);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue(leasePerson + " " + "批注人:" + " " + "审批人:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 1, (short) (list.size() - 1)));
|
||||
CellRangeAddress cellRange = new CellRangeAddress(rowNum - 1, rowNum - 1, 1, (short) (list.size() - 1));
|
||||
// 设置边框样式
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet);
|
||||
|
||||
|
||||
return rowNum;*/
|
||||
HSSFRow row = sheet.createRow(rowNum++);
|
||||
row.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (list.size() - 1)));
|
||||
|
|
@ -514,11 +570,6 @@ public class PoiOutPage {
|
|||
style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
|
||||
style.setRightBorderColor(IndexedColors.BLACK.getIndex());
|
||||
|
||||
|
||||
// 设置数字格式为保留两位小数
|
||||
DataFormat dataFormat = workbook.createDataFormat();
|
||||
style.setDataFormat(dataFormat.getFormat("0.00")); // 设置格式为"0.00"
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
|
|
@ -537,31 +588,31 @@ public class PoiOutPage {
|
|||
cell2.setCellStyle(titleStyle);
|
||||
cell2.setCellValue(unit);
|
||||
|
||||
// 第二行:领料工程
|
||||
// 第二行:领料单号
|
||||
HSSFRow row2 = sheet.createRow(rowNum++);
|
||||
row2.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell3 = row2.createCell(0);
|
||||
cell3.setCellStyle(titleStyle);
|
||||
cell3.setCellValue("领料工程:");
|
||||
cell3.setCellValue("领料单号:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell4 = row2.createCell(2);
|
||||
cell4.setCellStyle(titleStyle);
|
||||
cell4.setCellValue(projectName);
|
||||
cell4.setCellValue(code);
|
||||
|
||||
// 第二行:领料单号
|
||||
// 第三行:领料工程
|
||||
HSSFRow row3 = sheet.createRow(rowNum++);
|
||||
row2.setHeightInPoints(30);
|
||||
row3.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell5 = row3.createCell(0);
|
||||
cell5.setCellStyle(titleStyle);
|
||||
cell5.setCellValue("领料单号:");
|
||||
cell5.setCellValue("领料工程:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell6 = row3.createCell(2);
|
||||
cell6.setCellStyle(titleStyle);
|
||||
cell6.setCellValue(code);
|
||||
cell6.setCellValue(projectName);
|
||||
|
||||
// 添加边框
|
||||
CellRangeAddress cellRange1 = new CellRangeAddress(rowNum - 3, rowNum - 3, 0, 1);
|
||||
|
|
@ -597,6 +648,174 @@ public class PoiOutPage {
|
|||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange6, sheet);
|
||||
|
||||
|
||||
return rowNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料单导出
|
||||
* @param result
|
||||
* @param list
|
||||
* @param fileName
|
||||
* @param unit
|
||||
* @param projectName
|
||||
* @param backTime
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static HSSFWorkbook excelForCheckBack(List<Map<String, Object>> result, List<String> list, String fileName, String unit, String projectName, String backTime, String code) {
|
||||
// 创建工作簿和工作表
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
HSSFSheet sheet = workbook.createSheet();
|
||||
sheet.setDefaultColumnWidth(16); // 设置列宽
|
||||
|
||||
// 创建样式
|
||||
HSSFCellStyle titleStyle = createTitleStyle(workbook);
|
||||
HSSFCellStyle headerStyle = createHeaderStyle(workbook);
|
||||
HSSFCellStyle contentStyle = createCellStyleCost(workbook);
|
||||
|
||||
// 设置工作簿名称
|
||||
workbook.setSheetName(0, fileName);
|
||||
|
||||
// 填充标题行
|
||||
int rowNum = 0;
|
||||
rowNum = createTitleRow(sheet, rowNum, fileName, titleStyle, list.size());
|
||||
rowNum = createProjectInfoRowBack(sheet, rowNum, unit, projectName, titleStyle, list.size(), backTime, code);
|
||||
|
||||
// 填充表头
|
||||
rowNum = createHeaderRow(sheet, rowNum, list, headerStyle);
|
||||
|
||||
// 填充数据行
|
||||
if (result != null && !result.isEmpty()) {
|
||||
rowNum = createDataRows(sheet, rowNum, result, contentStyle, list.size());
|
||||
} else {
|
||||
// 如果没有数据,则仅显示表头
|
||||
// rowNum++;
|
||||
// rowNum = createDataRows(sheet, rowNum, result, contentStyle, list.size());
|
||||
HSSFRow row = sheet.createRow(rowNum++);
|
||||
HSSFCell cell = row.createCell(0);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue("暂无数据");
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (list.size() - 1)));
|
||||
CellRangeAddress cellRange = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (list.size() - 1));
|
||||
// 设置边框样式
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料单导出
|
||||
* @param sheet
|
||||
* @param rowNum
|
||||
* @param unit
|
||||
* @param projectName
|
||||
* @param titleStyle
|
||||
* @param nColumn
|
||||
* @param backTime
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
private static int createProjectInfoRowBack(HSSFSheet sheet, int rowNum, String unit, String projectName, HSSFCellStyle titleStyle, int nColumn, String backTime, String code) {
|
||||
// 第一行:退料单位
|
||||
HSSFRow row1 = sheet.createRow(rowNum++);
|
||||
row1.setHeightInPoints(30);
|
||||
// bug修复:修改合并单元格区域,确保包含两个或以上单元格
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell1 = row1.createCell(0);
|
||||
cell1.setCellStyle(titleStyle);
|
||||
cell1.setCellValue("退料单位:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1)));
|
||||
HSSFCell cell2 = row1.createCell(2);
|
||||
cell2.setCellStyle(titleStyle);
|
||||
cell2.setCellValue(unit);
|
||||
|
||||
// 第二行:工程名称
|
||||
HSSFRow row2 = sheet.createRow(rowNum++);
|
||||
row2.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell3 = row2.createCell(0);
|
||||
cell3.setCellStyle(titleStyle);
|
||||
cell3.setCellValue("工程名称:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell4 = row2.createCell(2);
|
||||
cell4.setCellStyle(titleStyle);
|
||||
cell4.setCellValue(projectName);
|
||||
|
||||
// 第三行:编号
|
||||
HSSFRow row3 = sheet.createRow(rowNum++);
|
||||
row3.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell5 = row3.createCell(0);
|
||||
cell5.setCellStyle(titleStyle);
|
||||
cell5.setCellValue("编号:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell6 = row3.createCell(2);
|
||||
cell6.setCellStyle(titleStyle);
|
||||
cell6.setCellValue(code);
|
||||
|
||||
// 第三行:退料时间
|
||||
HSSFRow row4 = sheet.createRow(rowNum++);
|
||||
row4.setHeightInPoints(30);
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1));
|
||||
HSSFCell cell7 = row3.createCell(0);
|
||||
cell7.setCellStyle(titleStyle);
|
||||
cell7.setCellValue("退料时间:");
|
||||
|
||||
sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1))); // projectName 占剩余的22
|
||||
HSSFCell cell8 = row3.createCell(2);
|
||||
cell8.setCellStyle(titleStyle);
|
||||
cell8.setCellValue(backTime);
|
||||
|
||||
// 添加边框
|
||||
CellRangeAddress cellRange1 = new CellRangeAddress(rowNum - 4, rowNum - 4, 0, 1);
|
||||
CellRangeAddress cellRange2 = new CellRangeAddress(rowNum - 4, rowNum - 4, 2, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange3 = new CellRangeAddress(rowNum - 3, rowNum - 3, 0, 1);
|
||||
CellRangeAddress cellRange4 = new CellRangeAddress(rowNum - 3, rowNum - 3, 2, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange5 = new CellRangeAddress(rowNum - 2, rowNum - 2, 0, 1);
|
||||
CellRangeAddress cellRange6 = new CellRangeAddress(rowNum - 2, rowNum - 2, 2, (short) (nColumn - 1));
|
||||
CellRangeAddress cellRange7 = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 1);
|
||||
CellRangeAddress cellRange8 = new CellRangeAddress(rowNum - 1, rowNum - 1, 2, (short) (nColumn - 1));
|
||||
// 设置边框样式
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange1, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange2, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange3, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange4, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange5, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange6, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange7, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange7, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange7, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange7, sheet);
|
||||
RegionUtil.setBorderTop(BorderStyle.THIN, cellRange8, sheet);
|
||||
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange8, sheet);
|
||||
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange8, sheet);
|
||||
RegionUtil.setBorderRight(BorderStyle.THIN, cellRange8, sheet);
|
||||
|
||||
|
||||
return rowNum;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -655,11 +655,8 @@ public class TmTaskController extends BaseController {
|
|||
}
|
||||
|
||||
@Log(title = "导出领料申请任务详情", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/exportLeaseApplyListAll")
|
||||
public void exportInfo(@RequestParam(value = "taskId", required = false, defaultValue = "") String taskId,
|
||||
HttpServletResponse response) {
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(Long.parseLong(taskId));
|
||||
@PostMapping("/exportLeaseApplyListAll")
|
||||
public void exportInfo(TmTask task, HttpServletResponse response) {
|
||||
task.setFlag(1);
|
||||
List<TmTask> leaseAuditList = tmTaskService.getLeaseApplyListAll(task);
|
||||
tmTaskService.exportInfo(leaseAuditList, response);
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
LeaseOutDetails bean = list.get(i);
|
||||
bean.setId(i + 1);
|
||||
Map<String, Object> maps = outReceiveDetailsBeanToMap(bean);
|
||||
results.add(maps);
|
||||
}
|
||||
|
|
@ -257,7 +258,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
* @return
|
||||
*/
|
||||
private Map<String, Object> outReceiveDetailsBeanToMap(LeaseOutDetails bean) {
|
||||
Map<String, Object> maps = new LinkedHashMap<String, Object>();
|
||||
Map<String, Object> maps = new LinkedHashMap<>();
|
||||
maps.put("id", bean.getId());
|
||||
maps.put("typeName", bean.getTypeName());
|
||||
maps.put("typeModelName", bean.getTypeModelName());
|
||||
maps.put("maCode", bean.getMaCode());
|
||||
|
|
@ -275,7 +277,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
* @return
|
||||
*/
|
||||
private List<String> receiveDetailsHeader() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("序号");
|
||||
list.add("设备类型");
|
||||
list.add("规格型号");
|
||||
list.add("设备编码");
|
||||
|
|
|
|||
|
|
@ -736,13 +736,15 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
String fileName = "领料申请任务详情表";
|
||||
String projectName = "";
|
||||
String unitName = "";
|
||||
String type = "";
|
||||
List<LeaseApplyDetails> list = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(leaseAuditList)) {
|
||||
unitName = "领料单位:" + leaseAuditList.get(0).getDeptName();
|
||||
projectName = "领料工程:" + leaseAuditList.get(0).getProName();
|
||||
unitName = leaseAuditList.get(0).getDeptName();
|
||||
projectName = leaseAuditList.get(0).getProName();
|
||||
type = leaseAuditList.get(0).getCompanyId() == 101 ? "机具设备" : "调试设备";
|
||||
list = leaseAuditList.get(0).getLeaseApplyDetails();
|
||||
}
|
||||
expOutExcel(response, list, fileName, projectName, unitName);
|
||||
expOutExcel(response, list, fileName, unitName, projectName, type);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
|
|
@ -756,18 +758,19 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
* @param projectName
|
||||
* @param unitName
|
||||
*/
|
||||
private void expOutExcel(HttpServletResponse response, List<LeaseApplyDetails> list, String fileName, String projectName, String unitName)
|
||||
private void expOutExcel(HttpServletResponse response, List<LeaseApplyDetails> list, String fileName, String unitName, String projectName, String type)
|
||||
throws Exception {
|
||||
if (list != null && list.size() > 0) {
|
||||
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
LeaseApplyDetails bean = list.get(i);
|
||||
bean.setId(i + 1);
|
||||
Map<String, Object> maps = outReceiveDetailsBeanToMap(bean);
|
||||
results.add(maps);
|
||||
}
|
||||
List<String> headers = receiveDetailsHeader();
|
||||
HSSFWorkbook workbook = PoiOutPage.excelForCheck(results, headers, fileName, projectName, unitName);
|
||||
HSSFWorkbook workbook = PoiOutPage.excelForCheck(results, headers, fileName, unitName, projectName, type);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
|
|
@ -800,6 +803,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
*/
|
||||
private Map<String, Object> outReceiveDetailsBeanToMap(LeaseApplyDetails bean) {
|
||||
Map<String, Object> maps = new LinkedHashMap<String, Object>();
|
||||
maps.put("id", bean.getId());
|
||||
maps.put("typeName", bean.getTypeName());
|
||||
maps.put("typeModelName", bean.getTypeModelName());
|
||||
maps.put("unitName", bean.getUnitName());
|
||||
|
|
@ -815,6 +819,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
*/
|
||||
private List<String> receiveDetailsHeader() {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add("序号");
|
||||
list.add("类型名称");
|
||||
list.add("规格型号");
|
||||
list.add("计量单位");
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.material.controller;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.common.core.constant.Constants;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.ListPagingUtil;
|
||||
|
|
@ -107,6 +108,17 @@ public class BackApplyController extends BaseController {
|
|||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料申请详情导出
|
||||
* @param bean
|
||||
* @param response
|
||||
*/
|
||||
@Log(title = "退料单导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportMaterialReturnList")
|
||||
public void exportInfo(BackApplyInfo bean, HttpServletResponse response) {
|
||||
backApplyService.exportInfo(bean, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料审核详情
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
package com.bonus.sgzb.material.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
||||
import com.bonus.sgzb.common.core.utils.ListPagingUtil;
|
||||
import com.bonus.sgzb.common.core.utils.ServletUtils;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.domain.StorageStatus;
|
||||
import com.bonus.sgzb.material.mapper.StorageStatusMapper;
|
||||
import com.bonus.sgzb.material.service.StorageStatusService;
|
||||
|
|
@ -19,10 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
|
|
@ -79,9 +81,28 @@ public class StorageStatusController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--查询在用设备详情")
|
||||
@GetMapping("/getUserRecords")
|
||||
public AjaxResult getUserRecords(StorageStatus bean) {
|
||||
startPage();
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<MaType> list = storageStatusMapper.getUserRecords(bean);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
Iterator<MaType> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaType type = iterator.next();
|
||||
if (type.getBackId() == null) {
|
||||
continue;
|
||||
}
|
||||
// 根据退料id及类型查询设备状态
|
||||
List<MaType> typeList = storageStatusMapper.getTypeList(type);
|
||||
if (CollectionUtils.isNotEmpty(typeList)) {
|
||||
for (MaType maType1 : typeList) {
|
||||
if ("1".equals(maType1.getIsFinished()) && type.getNum().equals(maType1.getNum())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,4 +37,11 @@ public interface StorageStatusMapper {
|
|||
List<Integer> getxshdrk(StorageStatus bean);
|
||||
|
||||
List<MaType> getAllRecords(@Param("ids") Set<Integer> ids,@Param("bean") StorageStatus bean);
|
||||
|
||||
/**
|
||||
* 根据退料id及类型查询设备状态
|
||||
* @param maType
|
||||
* @return
|
||||
*/
|
||||
List<MaType> getTypeList(MaType maType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.material.domain.BackApplyDto;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -136,4 +137,11 @@ public interface BackApplyService {
|
|||
* @return
|
||||
*/
|
||||
boolean isBackApplyNumberCorrect(BackApplyInfo bean);
|
||||
|
||||
/**
|
||||
* 退料申请详情导出
|
||||
* @param bean
|
||||
* @param response
|
||||
*/
|
||||
void exportInfo(BackApplyInfo bean, HttpServletResponse response);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.utils.poi.PoiOutPage;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
|
|
@ -11,10 +13,15 @@ import com.bonus.sgzb.material.mapper.BackApplyMapper;
|
|||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import com.bonus.sgzb.material.vo.TypeTreeBuild;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -24,6 +31,7 @@ import java.util.stream.Collectors;
|
|||
* @date 2023/12/20 14:55
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BackApplyServiceImpl implements BackApplyService {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -567,6 +575,107 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料申请详情导出
|
||||
* @param bean
|
||||
* @param response
|
||||
*/
|
||||
@Override
|
||||
public void exportInfo(BackApplyInfo bean, HttpServletResponse response) {
|
||||
List<BackApplyInfo> viewByApply = backApplyMapper.getViewByApply(bean);
|
||||
try {
|
||||
String fileName = "退料单";
|
||||
String unitName = "";
|
||||
String projectName = "";
|
||||
String backTime = "";
|
||||
String code = "";
|
||||
if (CollUtil.isNotEmpty(viewByApply)) {
|
||||
unitName = viewByApply.get(0).getUnitName();
|
||||
projectName = viewByApply.get(0).getProName();
|
||||
backTime = viewByApply.get(0).getBackTime();
|
||||
code = viewByApply.get(0).getCode();
|
||||
}
|
||||
expOutExcel(response, viewByApply, fileName, unitName, projectName, backTime, code);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出退料单
|
||||
* @param response
|
||||
* @param list
|
||||
* @param fileName
|
||||
* @param unitName
|
||||
* @param projectName
|
||||
* @param backTime
|
||||
* @param code
|
||||
*/
|
||||
private void expOutExcel(HttpServletResponse response, List<BackApplyInfo> list, String fileName, String unitName, String projectName, String backTime, String code)
|
||||
throws Exception {
|
||||
if (list != null) {
|
||||
List<Map<String, Object>> results = new ArrayList<>();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
BackApplyInfo bean = list.get(i);
|
||||
bean.setId((long) (i + 1));
|
||||
Map<String, Object> maps = outReceiveDetailsBeanToMap(bean);
|
||||
results.add(maps);
|
||||
}
|
||||
List<String> headers = receiveDetailsHeader();
|
||||
HSSFWorkbook workbook = PoiOutPage.excelForCheckBack(results, headers, fileName,unitName, projectName, backTime, code);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
out = response.getOutputStream();
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}else{
|
||||
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
List<String> headers = receiveDetailsHeader();
|
||||
HSSFWorkbook workbook = PoiOutPage.excel(results, headers, fileName);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
out = response.getOutputStream();
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料详情表头
|
||||
* @return
|
||||
*/
|
||||
private List<String> receiveDetailsHeader() {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("序号");
|
||||
list.add("类型名称");
|
||||
list.add("规格型号");
|
||||
list.add("退料数量");
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退料详情导出
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> outReceiveDetailsBeanToMap(BackApplyInfo bean) {
|
||||
Map<String, Object> maps = new LinkedHashMap<>();
|
||||
maps.put("id", bean.getId());
|
||||
maps.put("typeName", bean.getTypeName());
|
||||
maps.put("typeCode", bean.getTypeCode());
|
||||
maps.put("num", bean.getNum());
|
||||
return maps;
|
||||
}
|
||||
|
||||
private int auditAllDetails(BackApplyDto dto) {
|
||||
int re = 0;
|
||||
if (CollUtil.isNotEmpty(dto.getBackApplyList())) {
|
||||
|
|
|
|||
|
|
@ -941,7 +941,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bad.pre_num AS num,
|
||||
bad.audit_num AS auditNum,
|
||||
bad.remark AS remark,
|
||||
IFNULL( aa.num, 0 ) AS useNum
|
||||
IFNULL( aa.num, 0 ) AS useNum,
|
||||
bai.code AS code
|
||||
FROM
|
||||
back_apply_details bad
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_machine mm ON mm.ma_id = bcd.ma_id
|
||||
LEFT JOIN back_apply_info ba ON bcd.parent_id = ba.id
|
||||
WHERE bcd.is_finished IS NOT NULL and bcd.is_finished = '1'
|
||||
and ba.back_source = '2'
|
||||
GROUP BY
|
||||
mt.type_id
|
||||
) AS subquery2 ON subquery1.type_id = subquery2.type_id
|
||||
|
|
@ -211,8 +210,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bpl.lot_name proName,
|
||||
mt.type_name modelName,
|
||||
mt2.type_name typeName,
|
||||
sai.num,
|
||||
mm.ma_code
|
||||
sai.num as num,
|
||||
mm.ma_code as maCode,
|
||||
sai.back_id as backId,
|
||||
sai.type_id as typeId,
|
||||
sai.ma_id as maId
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
|
|
@ -220,10 +222,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt on mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_machine mm on mm.ma_id = sai.ma_id
|
||||
LEFT JOIN back_check_details bcd ON sai.back_id = bcd.parent_id
|
||||
AND sai.type_id = bcd.type_id
|
||||
AND (sai.ma_id IS NULL OR sai.ma_id = bcd.ma_id)
|
||||
WHERE
|
||||
sai.type_id = #{typeId}
|
||||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
AND (bcd.is_finished IS NULL OR bcd.is_finished = '0')
|
||||
</select>
|
||||
<select id="getzk" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
|
|
@ -319,4 +323,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTypeList" resultType="com.bonus.sgzb.base.api.domain.MaType">
|
||||
SELECT
|
||||
parent_id as backId,
|
||||
back_num as num,
|
||||
is_finished as isFinished
|
||||
FROM
|
||||
back_check_details
|
||||
WHERE parent_id = #{backId}
|
||||
and type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
and ma_id = #{maId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue