总供应计划
This commit is contained in:
@ -5,15 +5,12 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
||||
import org.dromara.cailiaoshebei.domain.BusSuppliesprice;
|
||||
import org.dromara.cailiaoshebei.domain.bo.*;
|
||||
import org.dromara.cailiaoshebei.domain.vo.*;
|
||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
||||
import org.dromara.cailiaoshebei.service.IBusSuppliespriceService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.dromara.design.domain.bo.ObtainTheListReq;
|
||||
import org.dromara.design.domain.dto.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -0,0 +1,266 @@
|
||||
package org.dromara.common.utils.excel;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/13 14:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ExcelDynamicReader {
|
||||
|
||||
/**
|
||||
* 动态读取Excel文件并映射到实体类(使用无参构造函数+Setter方法)
|
||||
*/
|
||||
public static <T> List<T> readExcel(MultipartFile file, int skipRows, int startColumn,
|
||||
int endColumn, Class<T> clazz) throws Exception {
|
||||
List<T> dataList = new ArrayList<>();
|
||||
|
||||
// 验证参数有效性
|
||||
if (startColumn < 0 || endColumn < startColumn) {
|
||||
throw new IllegalArgumentException("列索引设置无效");
|
||||
}
|
||||
|
||||
// 获取实体类的所有字段
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
// 检查字段数量是否与要读取的列数匹配
|
||||
int columnCount = endColumn - startColumn + 1;
|
||||
if (fields.length != columnCount) {
|
||||
throw new IllegalArgumentException("实体类字段数量与要读取的列数不匹配: " +
|
||||
fields.length + " vs " + columnCount);
|
||||
}
|
||||
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = WorkbookFactory.create(inputStream)) {
|
||||
|
||||
// 获取第一个工作表
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// 从指定行开始读取数据(跳过skipRows行)
|
||||
for (int rowIndex = skipRows; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
if (row != null) {
|
||||
// 使用无参构造函数创建对象
|
||||
T entity = clazz.getDeclaredConstructor().newInstance();
|
||||
|
||||
// 读取指定范围内的列并通过Setter方法设置值
|
||||
for (int colIndex = startColumn, fieldIndex = 0;
|
||||
colIndex <= endColumn; colIndex++, fieldIndex++) {
|
||||
|
||||
Cell cell = row.getCell(colIndex);
|
||||
Field field = fields[fieldIndex];
|
||||
try {
|
||||
// 获取并转换单元格值
|
||||
Object value = getCellValueByType(cell, field.getType());
|
||||
|
||||
// 调用Setter方法设置值
|
||||
String setterName = "set" +
|
||||
field.getName().substring(0, 1).toUpperCase() +
|
||||
field.getName().substring(1);
|
||||
Method setter = clazz.getMethod(setterName, field.getType());
|
||||
setter.invoke(entity, value);
|
||||
} catch (Exception e) {
|
||||
// 增加详细的错误信息,方便调试
|
||||
throw new RuntimeException(
|
||||
String.format("行号: %d, 列号: %d, 字段名: %s, 字段类型: %s 赋值失败: %s",
|
||||
rowIndex + 1, colIndex + 1, field.getName(),
|
||||
field.getType().getSimpleName(), e.getMessage()),
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
dataList.add(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增强的类型转换方法,处理更多类型不匹配场景
|
||||
*/
|
||||
private static Object getCellValueByType(Cell cell, Class<?> fieldType) {
|
||||
if (cell == null) {
|
||||
return getDefaultValue(fieldType);
|
||||
}
|
||||
|
||||
CellType cellType = cell.getCellType();
|
||||
if (cellType == CellType.FORMULA) {
|
||||
cellType = cell.getCachedFormulaResultType();
|
||||
}
|
||||
|
||||
// 先获取原始值
|
||||
Object rawValue = getRawCellValue(cell, cellType);
|
||||
|
||||
// 如果已经匹配类型,直接返回
|
||||
if (rawValue == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 处理类型转换
|
||||
if (fieldType.isAssignableFrom(rawValue.getClass())) {
|
||||
return rawValue;
|
||||
}
|
||||
|
||||
// 字符串转其他类型
|
||||
if (rawValue instanceof String) {
|
||||
return convertFromString((String) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 数字转其他类型
|
||||
if (rawValue instanceof Number) {
|
||||
return convertFromNumber((Number) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 日期转其他类型
|
||||
if (rawValue instanceof Date) {
|
||||
return convertFromDate((Date) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 布尔值转其他类型
|
||||
if (rawValue instanceof Boolean) {
|
||||
return convertFromBoolean((Boolean) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 无法转换时返回字符串表示
|
||||
return rawValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单元格原始值
|
||||
*/
|
||||
private static Object getRawCellValue(Cell cell, CellType cellType) {
|
||||
switch (cellType) {
|
||||
case STRING:
|
||||
return cell.getStringCellValue().trim();
|
||||
case NUMERIC:
|
||||
if (DateUtil.isCellDateFormatted(cell)) {
|
||||
return cell.getDateCellValue();
|
||||
} else {
|
||||
return cell.getNumericCellValue();
|
||||
}
|
||||
case BOOLEAN:
|
||||
return cell.getBooleanCellValue();
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从字符串转换到目标类型
|
||||
*/
|
||||
private static Object convertFromString(String value, Class<?> targetType) {
|
||||
if (value.isEmpty()) {
|
||||
return getDefaultValue(targetType);
|
||||
}
|
||||
|
||||
try {
|
||||
if (targetType == Integer.class || targetType == int.class) {
|
||||
return Integer.parseInt(value);
|
||||
} else if (targetType == Long.class || targetType == long.class) {
|
||||
return Long.parseLong(value);
|
||||
} else if (targetType == Double.class || targetType == double.class) {
|
||||
return Double.parseDouble(value);
|
||||
} else if (targetType == Float.class || targetType == float.class) {
|
||||
return Float.parseFloat(value);
|
||||
} else if (targetType == BigDecimal.class) {
|
||||
return new BigDecimal(value);
|
||||
} else if (targetType == Boolean.class || targetType == boolean.class) {
|
||||
return "true".equalsIgnoreCase(value) || "1".equals(value);
|
||||
} else if (targetType == LocalDate.class) {
|
||||
// 支持多种日期格式
|
||||
String[] patterns = {"yyyy-MM-dd", "yyyy/MM/dd", "MM/dd/yyyy", "dd-MM-yyyy"};
|
||||
for (String pattern : patterns) {
|
||||
try {
|
||||
return LocalDate.parse(value, DateTimeFormatter.ofPattern(pattern, Locale.US));
|
||||
} catch (Exception e) {
|
||||
// 尝试下一种格式
|
||||
}
|
||||
}
|
||||
// 最后尝试默认格式
|
||||
return LocalDate.parse(value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("无法将字符串 '" + value + "' 转换为 " + targetType.getSimpleName(), e);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从数字转换到目标类型
|
||||
*/
|
||||
private static Object convertFromNumber(Number number, Class<?> targetType) {
|
||||
if (targetType == Integer.class || targetType == int.class) {
|
||||
return number.intValue();
|
||||
} else if (targetType == Long.class || targetType == long.class) {
|
||||
return number.longValue();
|
||||
} else if (targetType == Double.class || targetType == double.class) {
|
||||
return number.doubleValue();
|
||||
} else if (targetType == Float.class || targetType == float.class) {
|
||||
return number.floatValue();
|
||||
} else if (targetType == BigDecimal.class) {
|
||||
return BigDecimal.valueOf(number.doubleValue());
|
||||
} else if (targetType == String.class) {
|
||||
return number.toString();
|
||||
} else if (targetType == Boolean.class || targetType == boolean.class) {
|
||||
return number.doubleValue() != 0;
|
||||
}
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从日期转换到目标类型
|
||||
*/
|
||||
private static Object convertFromDate(Date date, Class<?> targetType) {
|
||||
if (targetType == LocalDate.class) {
|
||||
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
} else if (targetType == String.class) {
|
||||
return date.toString();
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从布尔值转换到目标类型
|
||||
*/
|
||||
private static Object convertFromBoolean(Boolean bool, Class<?> targetType) {
|
||||
if (targetType == String.class) {
|
||||
return bool.toString();
|
||||
} else if (targetType == Integer.class || targetType == int.class) {
|
||||
return bool ? 1 : 0;
|
||||
}
|
||||
|
||||
return bool;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字段类型的默认值
|
||||
*/
|
||||
private static Object getDefaultValue(Class<?> fieldType) {
|
||||
if (fieldType.isPrimitive()) {
|
||||
if (fieldType == boolean.class) return false;
|
||||
return 0;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ package org.dromara.design.controller;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
import org.dromara.design.domain.dto.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -17,10 +17,7 @@ import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -47,7 +44,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
@Log(title = "导入excel", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/importExcelFile")
|
||||
public R<Void> importExcelFile(ImportExcelFileReq bo, @RequestParam("file") MultipartFile file) throws IOException {
|
||||
public R<Void> importExcelFile(ImportExcelFileReq bo, @RequestParam("file") MultipartFile file) throws Exception {
|
||||
return toAjax(busBillofquantitiesVersionsService.importExcelFile(bo,file));
|
||||
}
|
||||
|
||||
@ -78,6 +75,31 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
return R.ok(busBillofquantitiesVersionsService.obtainTheList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 物资设备清单审批详情
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:detailsMaterialAndEquipmentApproval")
|
||||
@GetMapping("/detailsMaterialAndEquipmentApproval/{versions}")
|
||||
public R<DetailsMaterialAndEquipmentApprovalRes> detailsMaterialAndEquipmentApproval(@PathVariable("versions") String versions) {
|
||||
return R.ok(busBillofquantitiesVersionsService.detailsMaterialAndEquipmentApproval(versions));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
// * 导入物资设备清单
|
||||
// */
|
||||
// @SaCheckPermission("design:billofquantitiesVersions:ListOfMaterialsAndEquipment")
|
||||
// @Log(title = "导入物资设备清单", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping("/ListOfMaterialsAndEquipment")
|
||||
// public R<Void> ListOfMaterialsAndEquipment(ImportExcelFileReq bo, @RequestParam("file") MultipartFile file) throws IOException {
|
||||
// ExcelReader.ExcelData excelData = ExcelReader.readExcelFromMultipartFile(file);
|
||||
// return toAjax(busBillofquantitiesVersionsService.importExcelFile(bo,file));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 查询工程量清单版本列表
|
||||
// */
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.design.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
@ -11,6 +12,8 @@ import org.dromara.design.domain.bo.DrawingReviewUploadReq;
|
||||
import org.dromara.design.domain.bo.FillOutTheDesignVerificationFormReq;
|
||||
import org.dromara.design.domain.vo.*;
|
||||
import org.dromara.design.service.IBusDrawingreviewReceiptsService;
|
||||
import org.dromara.project.domain.vo.project.BusSubProjectVo;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -43,6 +46,10 @@ public class BusDrawingreviewController extends BaseController {
|
||||
|
||||
private final IBusDrawingreviewReceiptsService busDrawingreviewReceiptsService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
/**
|
||||
* 新增设计图纸评审
|
||||
*/
|
||||
@ -113,13 +120,23 @@ public class BusDrawingreviewController extends BaseController {
|
||||
* 填写设计验证表
|
||||
*/
|
||||
@SaCheckPermission("design:drawingreview:fillOutTheDesignVerificationForm")
|
||||
@Log(title = "重新上传设计图纸评审", businessType = BusinessType.INSERT)
|
||||
@Log(title = "填写设计验证表", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/fillOutTheDesignVerificationForm")
|
||||
public R<Void> fillOutTheDesignVerificationForm(@RequestBody FillOutTheDesignVerificationFormReq bo) {
|
||||
return toAjax(busDrawingreviewService.fillOutTheDesignVerificationForm(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目下的子项目列表
|
||||
*/
|
||||
@SaCheckPermission("design:drawingreviewReceipts:subProjectList")
|
||||
@GetMapping("/subProjectList/{id}")
|
||||
public R<List<BusSubProjectVo>> listSubProject(@NotNull(message = "项目id不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(projectService.querySubList(id));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 查询设计-图纸评审列表
|
||||
// */
|
||||
|
@ -2,10 +2,13 @@ package org.dromara.design.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.project.domain.vo.project.BusSubProjectVo;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -36,6 +39,7 @@ public class BusDrawingreviewReceiptsController extends BaseController {
|
||||
|
||||
private final IBusDrawingreviewReceiptsService busDrawingreviewReceiptsService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设计-图纸评审验证列表
|
||||
*/
|
||||
@ -102,4 +106,6 @@ public class BusDrawingreviewReceiptsController extends BaseController {
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busDrawingreviewReceiptsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.design.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.design.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.design.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/design/totalsupplyplan")
|
||||
public class BusTotalsupplyplanController extends BaseController {
|
||||
|
||||
private final IBusTotalsupplyplanService busTotalsupplyplanService;
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划列表
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusTotalsupplyplanVo> list(BusTotalsupplyplanBo bo, PageQuery pageQuery) {
|
||||
return busTotalsupplyplanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-总供应计划列表
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:export")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusTotalsupplyplanBo bo, HttpServletResponse response) {
|
||||
List<BusTotalsupplyplanVo> list = busTotalsupplyplanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-总供应计划", BusTotalsupplyplanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-总供应计划详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusTotalsupplyplanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busTotalsupplyplanService.queryById(id));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 新增物资-总供应计划
|
||||
// */
|
||||
// @SaCheckPermission("design:totalsupplyplan:add")
|
||||
// @Log(title = "物资-总供应计划", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody BusTotalsupplyplanBo bo) {
|
||||
// return toAjax(busTotalsupplyplanService.insertByBo(bo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:edit")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusTotalsupplyplanBo bo) {
|
||||
return toAjax(busTotalsupplyplanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 删除物资-总供应计划
|
||||
// *
|
||||
// * @param ids 主键串
|
||||
// */
|
||||
// @SaCheckPermission("design:totalsupplyplan:remove")
|
||||
// @Log(title = "物资-总供应计划", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(busTotalsupplyplanService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
}
|
@ -50,5 +50,10 @@ public class BusBillofquantitiesVersions extends BaseEntity {
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -129,17 +131,17 @@ public class BusDrawingreviewReceipts extends BaseEntity {
|
||||
/**
|
||||
* 校审时间
|
||||
*/
|
||||
private Date proofreadingDate;
|
||||
private LocalDate proofreadingDate;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date auditDate;
|
||||
private LocalDate auditDate;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Date executorDate;
|
||||
private LocalDate executorDate;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
|
@ -0,0 +1,118 @@
|
||||
package org.dromara.design.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_totalsupplyplan")
|
||||
public class BusTotalsupplyplan extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
private Date compileDate;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
private String planNumber;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package org.dromara.design.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核对象 bus_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_totalsupplyplan_audit")
|
||||
public class BusTotalsupplyplanAudit extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package org.dromara.design.domain.bo;
|
||||
|
||||
import org.dromara.design.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核业务对象 bus_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusTotalsupplyplanAudit.class, reverseConvertGenerate = false)
|
||||
public class BusTotalsupplyplanAuditBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@NotBlank(message = "批次号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package org.dromara.design.domain.bo;
|
||||
|
||||
import org.dromara.design.domain.BusTotalsupplyplan;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划业务对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusTotalsupplyplan.class, reverseConvertGenerate = false)
|
||||
public class BusTotalsupplyplanBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -116,17 +117,17 @@ public class FillOutTheDesignVerificationFormReq implements Serializable {
|
||||
/**
|
||||
* 校审时间
|
||||
*/
|
||||
private Date proofreadingDate;
|
||||
private LocalDate proofreadingDate;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date auditDate;
|
||||
private LocalDate auditDate;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Date executorDate;
|
||||
private LocalDate executorDate;
|
||||
|
||||
|
||||
}
|
||||
|
@ -32,9 +32,8 @@ public class ObtainTheListReq implements Serializable {
|
||||
private String versions;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
* 表名 不传递就是物资材料
|
||||
*/
|
||||
@NotBlank(message = "表名不能为空")
|
||||
private String sheet;
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,51 @@
|
||||
package org.dromara.design.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/13 14:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MaterialsAndEquipmentExcelDto implements Serializable {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
@ -54,5 +54,10 @@ public class BusBillofquantitiesVersionsVo implements Serializable {
|
||||
@ExcelProperty(value = "Excel文件")
|
||||
private String excelFile;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.design.domain.BusDrawingreviewReceipts;
|
||||
@ -154,19 +155,19 @@ public class BusDrawingreviewReceiptsVo implements Serializable {
|
||||
* 校审时间
|
||||
*/
|
||||
@ExcelProperty(value = "校审时间")
|
||||
private Date proofreadingDate;
|
||||
private LocalDate proofreadingDate;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@ExcelProperty(value = "审核时间")
|
||||
private Date auditDate;
|
||||
private LocalDate auditDate;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@ExcelProperty(value = "执行时间")
|
||||
private Date executorDate;
|
||||
private LocalDate executorDate;
|
||||
|
||||
/**
|
||||
* 图纸
|
||||
|
@ -0,0 +1,62 @@
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import org.dromara.design.domain.BusTotalsupplyplanAudit;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核视图对象 bus_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusTotalsupplyplanAudit.class)
|
||||
public class BusTotalsupplyplanAuditVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ExcelProperty(value = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.design.domain.BusTotalsupplyplan;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物资-总供应计划视图对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusTotalsupplyplan.class)
|
||||
public class BusTotalsupplyplanVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
@ExcelProperty(value = "编制日期")
|
||||
private Date compileDate;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@ExcelProperty(value = "计划编号")
|
||||
private String planNumber;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ExcelProperty(value = "编号")
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@ExcelProperty(value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
@ExcelProperty(value = "质量标准")
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
@ExcelProperty(value = "预计使用日期")
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@ExcelProperty(value = "交货地点")
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
@ExcelProperty(value = "使用部位")
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/13 16:24
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DetailsMaterialAndEquipmentApprovalRes implements Serializable {
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String versions;
|
||||
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 审核数据
|
||||
*/
|
||||
private List<BusBillofquantities> auditData;
|
||||
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
package org.dromara.design.domain.dto;
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
@ -1,14 +1,11 @@
|
||||
package org.dromara.design.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.design.domain.bo.ObtainTheListReq;
|
||||
import org.dromara.design.domain.dto.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.design.mapper;
|
||||
|
||||
import org.dromara.design.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusTotalsupplyplanAuditMapper extends BaseMapperPlus<BusTotalsupplyplanAudit, BusTotalsupplyplanAuditVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.design.mapper;
|
||||
|
||||
import org.dromara.design.domain.BusTotalsupplyplan;
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusTotalsupplyplanMapper extends BaseMapperPlus<BusTotalsupplyplan, BusTotalsupplyplanVo> {
|
||||
|
||||
}
|
@ -1,18 +1,17 @@
|
||||
package org.dromara.design.service;
|
||||
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
import org.dromara.design.domain.dto.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -77,7 +76,7 @@ public interface IBusBillofquantitiesVersionsService extends IService<BusBillofq
|
||||
/**
|
||||
* 导入excel
|
||||
*/
|
||||
Boolean importExcelFile(ImportExcelFileReq bo, MultipartFile file) throws IOException;
|
||||
Boolean importExcelFile(ImportExcelFileReq bo, MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取所有版本号
|
||||
@ -90,4 +89,9 @@ public interface IBusBillofquantitiesVersionsService extends IService<BusBillofq
|
||||
* 获取工程量清单
|
||||
*/
|
||||
List<ObtainTheListRes> obtainTheList(ObtainTheListReq bo);
|
||||
|
||||
/**
|
||||
* 物资设备清单审批详情
|
||||
*/
|
||||
DetailsMaterialAndEquipmentApprovalRes detailsMaterialAndEquipmentApproval(String versions);
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.design.service;
|
||||
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.design.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.design.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusTotalsupplyplanAuditService extends IService<BusTotalsupplyplanAudit>{
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划审核
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划审核
|
||||
*/
|
||||
BusTotalsupplyplanAuditVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划审核分页列表
|
||||
*/
|
||||
TableDataInfo<BusTotalsupplyplanAuditVo> queryPageList(BusTotalsupplyplanAuditBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划审核列表
|
||||
*/
|
||||
List<BusTotalsupplyplanAuditVo> queryList(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划审核信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.design.service;
|
||||
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.design.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.design.domain.BusTotalsupplyplan;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusTotalsupplyplanService extends IService<BusTotalsupplyplan>{
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划
|
||||
*/
|
||||
BusTotalsupplyplanVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划分页列表
|
||||
*/
|
||||
TableDataInfo<BusTotalsupplyplanVo> queryPageList(BusTotalsupplyplanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划列表
|
||||
*/
|
||||
List<BusTotalsupplyplanVo> queryList(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
@ -12,27 +19,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.common.utils.excel.ExcelDynamicReader;
|
||||
import org.dromara.design.domain.*;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
import org.dromara.design.domain.dto.ObtainTheListRes;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
import org.dromara.design.mapper.BusBillofquantitiesMapper;
|
||||
import org.dromara.design.domain.dto.MaterialsAndEquipmentExcelDto;
|
||||
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.dromara.design.service.IBusTotalsupplyplanAuditService;
|
||||
import org.dromara.design.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.design.mapper.BusBillofquantitiesVersionsMapper;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.common.constant.MinioPathConstant.BillOfQuantities;
|
||||
@ -45,10 +53,13 @@ import static org.dromara.common.constant.MinioPathConstant.BillOfQuantities;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillofquantitiesVersionsMapper, BusBillofquantitiesVersions> implements IBusBillofquantitiesVersionsService {
|
||||
|
||||
private final BusBillofquantitiesVersionsMapper baseMapper;
|
||||
private final IBusBillofquantitiesService busBillofquantitiesService;
|
||||
private final IBusTotalsupplyplanService busTotalsupplyplanService;
|
||||
private final IBusTotalsupplyplanAuditService busTotalsupplyplanAuditService;
|
||||
|
||||
@Autowired
|
||||
private ISysOssService ossService;
|
||||
@ -156,8 +167,8 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
* 导入excel
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean importExcelFile(ImportExcelFileReq bo, MultipartFile file) throws IOException {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean importExcelFile(ImportExcelFileReq bo, MultipartFile file) throws Exception {
|
||||
//0、创建版本
|
||||
SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(BillOfQuantities,file));
|
||||
if(wordEntity==null){
|
||||
@ -171,22 +182,21 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
setExcelFile(wordEntity.getUrl()));
|
||||
|
||||
if(insert<=0){
|
||||
throw new ServiceException("创建版本失败");
|
||||
throw new RuntimeException("创建版本失败");
|
||||
}
|
||||
//1、获取到解析数据
|
||||
ExcelReader.ExcelData excelData = ExcelReader.readExcelFromMultipartFile(file);
|
||||
//走正常的工程清单
|
||||
if(!Objects.equals(bo.getWorkOrderType(), "3")){
|
||||
// 2. 解析所有工作表,转换为带父子关系的ExcelMaterial列表 解析所有Sheet数据,按规则生成sid和pid
|
||||
List<BusBillofquantities> allMaterials = new ArrayList<>();
|
||||
for (ExcelReader.SheetData sheetData : excelData.getSheetDataList()) {
|
||||
String sheetName = sheetData.getSheetName();
|
||||
List<List<String>> rowDataList = sheetData.getData();
|
||||
|
||||
// 构建当前Sheet的树形结构(复用ExcelReader的buildTree方法)
|
||||
ExcelReader.TreeNode rootNode = ExcelReader.buildTree(rowDataList);
|
||||
|
||||
// 存储节点映射:TreeNode → ExcelMaterial(用于子节点关联父节点)
|
||||
Map<ExcelReader.TreeNode, BusBillofquantities> nodeMap = new HashMap<>();
|
||||
|
||||
// 递归遍历树形结构,生成sid和pid
|
||||
traverseTree(rootNode, nodeMap, allMaterials, sheetName,banBen);
|
||||
}
|
||||
@ -196,9 +206,29 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
}
|
||||
boolean b = busBillofquantitiesService.saveBatch(allMaterials);
|
||||
if(!b){
|
||||
throw new ServiceException("导入失败");
|
||||
throw new RuntimeException("导入失败");
|
||||
}
|
||||
return true;
|
||||
}else{
|
||||
// 跳过1行(表头),读取0到6列(共7列),映射到ExcelData实体类
|
||||
List<MaterialsAndEquipmentExcelDto> dataList = ExcelDynamicReader.readExcel(
|
||||
file, // 上传的文件
|
||||
1, // 跳过1行(表头)
|
||||
0, // 从第0列开始
|
||||
5, // 到第5列结束
|
||||
MaterialsAndEquipmentExcelDto.class // 目标实体类
|
||||
);
|
||||
List<BusBillofquantities> busBillofquantities = BeanUtil.copyToList(dataList, BusBillofquantities.class);
|
||||
for (BusBillofquantities busBillofquantity : busBillofquantities) {
|
||||
busBillofquantity.setProjectId(bo.getProjectId());
|
||||
busBillofquantity.setVersions(banBen);
|
||||
}
|
||||
boolean b = busBillofquantitiesService.saveBatch(busBillofquantities);
|
||||
if(!b){
|
||||
throw new RuntimeException("导入失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +239,10 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
if (flatList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// sheet为空表示不走下面的代码
|
||||
if(StringUtils.isBlank(bo.getSheet())){
|
||||
return flatList;
|
||||
}
|
||||
// 2. 构建父子映射:key=父节点pid,value=该父节点的所有子节点
|
||||
Map<String, List<ObtainTheListRes>> parentMap = flatList.stream()
|
||||
.collect(Collectors.groupingBy(ObtainTheListRes::getPid));
|
||||
@ -220,6 +253,25 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
return treeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailsMaterialAndEquipmentApprovalRes detailsMaterialAndEquipmentApproval(String versions) {
|
||||
DetailsMaterialAndEquipmentApprovalRes detailsMaterialAndEquipmentApprovalRes = new DetailsMaterialAndEquipmentApprovalRes();
|
||||
//根据版本号获取数据
|
||||
BusBillofquantitiesVersions busBillofquantitiesVersions = baseMapper.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>().eq(BusBillofquantitiesVersions::getVersions, versions));
|
||||
if(busBillofquantitiesVersions==null){
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
//根据版本号获取物资设备清单
|
||||
List<BusBillofquantities> busBillofquantities = busBillofquantitiesService.list(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getVersions, versions));
|
||||
if(busBillofquantities==null){
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
detailsMaterialAndEquipmentApprovalRes.setVersions(busBillofquantitiesVersions.getVersions());
|
||||
detailsMaterialAndEquipmentApprovalRes.setStatus(busBillofquantitiesVersions.getStatus());
|
||||
detailsMaterialAndEquipmentApprovalRes.setAuditData(busBillofquantities);
|
||||
return detailsMaterialAndEquipmentApprovalRes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归构建树形结构
|
||||
* @param parentId 父节点ID(顶级节点为0)
|
||||
@ -352,6 +404,9 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWorkOrderType()), BusBillofquantitiesVersions::getWorkOrderType, bo.getWorkOrderType());
|
||||
lqw.orderByDesc(BusBillofquantitiesVersions::getCreateTime);
|
||||
Page<BusBillofquantitiesVersionsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(item -> {
|
||||
System.out.println("1 "+item.getStatus());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -374,4 +429,79 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("物资设备清单审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
//变更状态
|
||||
LambdaQueryWrapper<BusBillofquantitiesVersions> eq = new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||
.eq(BusBillofquantitiesVersions::getVersions, id);
|
||||
BusBillofquantitiesVersions busBillofquantitiesVersions = new BusBillofquantitiesVersions();
|
||||
busBillofquantitiesVersions.setStatus(processEvent.getStatus());
|
||||
boolean update = this.update(busBillofquantitiesVersions, eq);
|
||||
//变更成功,增加数据
|
||||
if (update) {
|
||||
//2、根据版本号查询数据
|
||||
BusBillofquantitiesVersions versions = this.getOne(eq);
|
||||
//2、新增批次号
|
||||
String num = BatchNumberGenerator.generateBatchNumber("ZGY-");
|
||||
BusTotalsupplyplanAudit busTotalsupplyplanAudit = new BusTotalsupplyplanAudit();
|
||||
busTotalsupplyplanAudit.setProjectId(versions.getProjectId());
|
||||
busTotalsupplyplanAudit.setBatchNumber(num);
|
||||
boolean save = busTotalsupplyplanAuditService.save(busTotalsupplyplanAudit);
|
||||
if (!save){
|
||||
log.info("新增失败");
|
||||
}
|
||||
//1、根据查询数据
|
||||
LambdaQueryWrapper<BusBillofquantities> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(BusBillofquantities::getVersions, id);
|
||||
lqw.last("limit 1");
|
||||
List<BusBillofquantities> list = busBillofquantitiesService.list(lqw);
|
||||
List<BusTotalsupplyplan> busTotalsupplyplans = BeanUtil.copyToList(list, BusTotalsupplyplan.class);
|
||||
for (BusTotalsupplyplan busTotalsupplyplan : busTotalsupplyplans) {
|
||||
busTotalsupplyplan.setBatchNumber(num);
|
||||
busTotalsupplyplan.setProjectId(versions.getProjectId());
|
||||
}
|
||||
boolean b = busTotalsupplyplanService.saveBatch(busTotalsupplyplans);
|
||||
if (!b){
|
||||
log.info("新增失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资设备清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("物资设备清单计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -232,8 +232,18 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
|
||||
|
||||
@Override
|
||||
public Boolean fillOutTheDesignVerificationForm(FillOutTheDesignVerificationFormReq bo) {
|
||||
//1、根据id获取到主数据下的最新子数据
|
||||
LambdaQueryWrapper<BusDrawingreviewReceipts> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(BusDrawingreviewReceipts::getDrawingreviewId, bo.getId());
|
||||
lqw.orderByDesc(BusDrawingreviewReceipts::getCreateTime);
|
||||
lqw.last("limit 1");
|
||||
BusDrawingreviewReceipts one = busDrawingreviewReceiptsService.getOne(lqw);
|
||||
if (one == null) {
|
||||
throw new RuntimeException("查询失败");
|
||||
}
|
||||
//修改busDrawingreviewReceiptsService数据
|
||||
BusDrawingreviewReceipts busDrawingreviewReceipts = BeanUtil.copyProperties(bo, BusDrawingreviewReceipts.class);
|
||||
busDrawingreviewReceipts.setId(one.getId());
|
||||
return busDrawingreviewReceiptsService.updateById(busDrawingreviewReceipts);
|
||||
}
|
||||
|
||||
@ -250,7 +260,6 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("图纸评审审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
System.out.println("???????????? "+id);
|
||||
//1、根据id查询到子数据
|
||||
LambdaQueryWrapper<BusDrawingreviewReceipts> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(BusDrawingreviewReceipts::getDrawingreviewId, id);
|
||||
|
@ -0,0 +1,133 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.design.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.design.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.design.mapper.BusTotalsupplyplanAuditMapper;
|
||||
import org.dromara.design.service.IBusTotalsupplyplanAuditService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusTotalsupplyplanAuditServiceImpl extends ServiceImpl<BusTotalsupplyplanAuditMapper, BusTotalsupplyplanAudit> implements IBusTotalsupplyplanAuditService {
|
||||
|
||||
private final BusTotalsupplyplanAuditMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划审核
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划审核
|
||||
*/
|
||||
@Override
|
||||
public BusTotalsupplyplanAuditVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划审核分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusTotalsupplyplanAuditVo> queryPageList(BusTotalsupplyplanAuditBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = buildQueryWrapper(bo);
|
||||
Page<BusTotalsupplyplanAuditVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划审核列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusTotalsupplyplanAuditVo> queryList(BusTotalsupplyplanAuditBo bo) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusTotalsupplyplanAudit> buildQueryWrapper(BusTotalsupplyplanAuditBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusTotalsupplyplanAudit::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusTotalsupplyplanAudit::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatchNumber()), BusTotalsupplyplanAudit::getBatchNumber, bo.getBatchNumber());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusTotalsupplyplanAudit::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusTotalsupplyplanAuditBo bo) {
|
||||
BusTotalsupplyplanAudit add = MapstructUtils.convert(bo, BusTotalsupplyplanAudit.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusTotalsupplyplanAuditBo bo) {
|
||||
BusTotalsupplyplanAudit update = MapstructUtils.convert(bo, BusTotalsupplyplanAudit.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusTotalsupplyplanAudit entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划审核信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.design.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.design.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.design.domain.BusTotalsupplyplan;
|
||||
import org.dromara.design.mapper.BusTotalsupplyplanMapper;
|
||||
import org.dromara.design.service.IBusTotalsupplyplanService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplyplanMapper, BusTotalsupplyplan> implements IBusTotalsupplyplanService {
|
||||
|
||||
private final BusTotalsupplyplanMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划
|
||||
*/
|
||||
@Override
|
||||
public BusTotalsupplyplanVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusTotalsupplyplanVo> queryPageList(BusTotalsupplyplanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = buildQueryWrapper(bo);
|
||||
Page<BusTotalsupplyplanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusTotalsupplyplanVo> queryList(BusTotalsupplyplanBo bo) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusTotalsupplyplan> buildQueryWrapper(BusTotalsupplyplanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusTotalsupplyplan::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTexture()), BusTotalsupplyplan::getTexture, bo.getTexture());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBrand()), BusTotalsupplyplan::getBrand, bo.getBrand());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQualityStandard()), BusTotalsupplyplan::getQualityStandard, bo.getQualityStandard());
|
||||
lqw.eq(bo.getDateService() != null, BusTotalsupplyplan::getDateService, bo.getDateService());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeliveryPoints()), BusTotalsupplyplan::getDeliveryPoints, bo.getDeliveryPoints());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPartUsed()), BusTotalsupplyplan::getPartUsed, bo.getPartUsed());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusTotalsupplyplanBo bo) {
|
||||
BusTotalsupplyplan add = MapstructUtils.convert(bo, BusTotalsupplyplan.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusTotalsupplyplanBo bo) {
|
||||
BusTotalsupplyplan update = MapstructUtils.convert(bo, BusTotalsupplyplan.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusTotalsupplyplan entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("物资总供应计划审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资总供应计划审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("物资总供应计划计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
}
|
@ -4,13 +4,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.design.mapper.BusBillofquantitiesVersionsMapper">
|
||||
|
||||
<select id="obtainTheList" resultType="org.dromara.design.domain.dto.ObtainTheListRes">
|
||||
<select id="obtainTheList" resultType="org.dromara.design.domain.vo.ObtainTheListRes">
|
||||
select
|
||||
*
|
||||
from
|
||||
bus_billofquantities
|
||||
<where>
|
||||
versions = #{bo.versions} AND sheet = #{bo.sheet} AND project_id = #{bo.projectId}
|
||||
versions = #{bo.versions}
|
||||
<if test="bo.projectId != null">
|
||||
AND project_id = #{bo.projectId}
|
||||
</if>
|
||||
<if test="bo.sheet != null">
|
||||
AND `sheet` = #{bo.sheet}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.design.mapper.BusTotalsupplyplanAuditMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.design.mapper.BusTotalsupplyplanMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user