Compare commits
32 Commits
prod
...
162120ec31
Author | SHA1 | Date | |
---|---|---|---|
162120ec31 | |||
382d4b034b | |||
63d21f8ec7 | |||
560cfc6658 | |||
2a327719e2 | |||
8ae7de2908 | |||
30d17b3051 | |||
4622875948 | |||
a7e2a9e43f | |||
faff8b81a9 | |||
bd382a71bb | |||
5596631979 | |||
ce09d8ba9c | |||
85f9d9b88e | |||
c9b3fae598 | |||
87d45b23e9 | |||
959677a575 | |||
4885d9a53a | |||
39f0c013f2 | |||
a7e51ed25c | |||
be85d7e598 | |||
bcb764ab27 | |||
91373d4556 | |||
de56bdecde | |||
a5aea783e9 | |||
c605d0c1eb | |||
cca6724947 | |||
c5d1623145 | |||
5dd70b21a3 | |||
7f51a48f17 | |||
4aa7861f66 | |||
e482e7d9d4 |
@ -24,6 +24,7 @@ public class SysIndexController
|
||||
@RequestMapping("/")
|
||||
public String index()
|
||||
{
|
||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||
// return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -101,13 +101,13 @@ public class AuthController {
|
||||
// 登录
|
||||
LoginVo loginVo = IAuthStrategy.login(body, client, grantType);
|
||||
|
||||
Long userId = LoginHelper.getUserId();
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
SseMessageDto dto = new SseMessageDto();
|
||||
dto.setMessage("欢迎登录新能源项目管理系统");
|
||||
dto.setUserIds(List.of(userId));
|
||||
SseMessageUtils.publishMessage(dto);
|
||||
}, 5, TimeUnit.SECONDS);
|
||||
// Long userId = LoginHelper.getUserId();
|
||||
// scheduledExecutorService.schedule(() -> {
|
||||
// SseMessageDto dto = new SseMessageDto();
|
||||
// dto.setMessage("欢迎登录新能源项目管理系统");
|
||||
// dto.setUserIds(List.of(userId));
|
||||
// SseMessageUtils.publishMessage(dto);
|
||||
// }, 5, TimeUnit.SECONDS);
|
||||
return R.ok(loginVo);
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ public class IndexController {
|
||||
*/
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||
// return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -288,3 +288,6 @@ id-card:
|
||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||
recognizer:
|
||||
url: http://192.168.110.5:50070
|
||||
|
||||
qrCode:
|
||||
url: http://192.168.110.151:7788
|
||||
|
@ -287,3 +287,6 @@ id-card:
|
||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||
recognizer:
|
||||
url: http://192.168.110.5:50070
|
||||
|
||||
qrCode:
|
||||
url: http://192.168.110.151:7788
|
||||
|
@ -261,6 +261,10 @@ springdoc:
|
||||
packages-to-scan: org.dromara.out
|
||||
- group: 19.消息模块
|
||||
packages-to-scan: org.dromara.message
|
||||
- group: 20.合同模块
|
||||
packages-to-scan: org.dromara.ctr
|
||||
- group: 21.招标模块
|
||||
packages-to-scan: org.dromara.tender
|
||||
# knife4j的增强配置,不需要增强可以不配
|
||||
knife4j:
|
||||
enable: true
|
||||
|
Binary file not shown.
@ -143,7 +143,7 @@ public class ExcelReader {
|
||||
|
||||
List<String> rowData = new ArrayList<>();
|
||||
// 读取A到E列(索引0到4)
|
||||
for (int cellIndex = 0; cellIndex < 5; cellIndex++) {
|
||||
for (int cellIndex = 0; cellIndex < 6; cellIndex++) {
|
||||
Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||
rowData.add(getCellValue(cell));
|
||||
}
|
||||
@ -228,51 +228,7 @@ public class ExcelReader {
|
||||
|
||||
return root;
|
||||
}
|
||||
// public static TreeNode buildTree(List<List<String>> data) {
|
||||
// TreeNode root = new TreeNode(new ArrayList<>());
|
||||
// Map<String, TreeNode> nodeMap = new HashMap<>();
|
||||
// nodeMap.put("", root);
|
||||
// List<String> nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序
|
||||
//
|
||||
// for (List<String> row : data) {
|
||||
// String key = row.get(0).trim();
|
||||
// TreeNode node = new TreeNode(row);
|
||||
//
|
||||
// if (!key.isEmpty()) {
|
||||
// String parentKey = getParentKey(key);
|
||||
// TreeNode parent = nodeMap.get(parentKey);
|
||||
//
|
||||
// if (parent == null) {
|
||||
// parent = new TreeNode(new ArrayList<>());
|
||||
// nodeMap.put(parentKey, parent);
|
||||
// TreeNode grandParent = nodeMap.get(getParentKey(parentKey));
|
||||
// if (grandParent != null) {
|
||||
// grandParent.addChild(parent);
|
||||
// } else {
|
||||
// // 如果没有更高级别的父节点,就挂到根节点
|
||||
// root.addChild(parent);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// parent.addChild(node);
|
||||
// nodeMap.put(key, node);
|
||||
// nonEmptyKeys.add(key);
|
||||
// } else {
|
||||
// // A列为空,挂到上一个非空节点下
|
||||
// if (!nonEmptyKeys.isEmpty()) {
|
||||
// String lastKey = nonEmptyKeys.get(nonEmptyKeys.size() - 1);
|
||||
// TreeNode parent = nodeMap.get(lastKey);
|
||||
// if (parent != null) {
|
||||
// parent.addChild(node);
|
||||
// }
|
||||
// } else {
|
||||
// root.addChild(node);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return root;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 以可视化方式打印树形结构
|
||||
@ -362,26 +318,7 @@ public class ExcelReader {
|
||||
// 其他格式默认父节点是根节点
|
||||
return "";
|
||||
}
|
||||
// private static String getParentKey(String key) {
|
||||
// // 中文数字(一、二、三...)的父节点是根节点
|
||||
// if (key.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// // 数字格式(1、1.1、1.2.1等)的父节点是上一级
|
||||
// if (key.matches("\\d+(\\.\\d+)*")) {
|
||||
// int lastDotIndex = key.lastIndexOf('.');
|
||||
// if (lastDotIndex > 0) {
|
||||
// return key.substring(0, lastDotIndex);
|
||||
// } else {
|
||||
// // 一级数字(如1、2)的父节点是根节点或最近的中文数字节点
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 其他格式默认父节点是根节点
|
||||
// return "";
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* Excel数据实体类,包含所有工作表数据
|
||||
@ -459,26 +396,6 @@ public class ExcelReader {
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
// public static class TreeNode {
|
||||
// List<String> data;
|
||||
// List<TreeNode> children;
|
||||
//
|
||||
// public TreeNode(List<String> data) {
|
||||
// this.data = data;
|
||||
// this.children = new ArrayList<>();
|
||||
// }
|
||||
//
|
||||
// public void addChild(TreeNode child) {
|
||||
// this.children.add(child);
|
||||
// }
|
||||
//
|
||||
// public List<String> getData() {
|
||||
// return data;
|
||||
// }
|
||||
//
|
||||
// public List<TreeNode> getChildren() {
|
||||
// return children;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import org.dromara.common.core.enums.UserType;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -20,14 +21,15 @@ public class SaPermissionImpl implements StpInterface {
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
UserType userType = UserType.getUserType(loginUser.getUserType());
|
||||
if (userType == UserType.SYS_USER) {
|
||||
return new ArrayList<>(loginUser.getMenuPermission());
|
||||
} else if (userType == UserType.APP_USER) {
|
||||
// 其他端 自行根据业务编写
|
||||
}
|
||||
return new ArrayList<>();
|
||||
// LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
// UserType userType = UserType.getUserType(loginUser.getUserType());
|
||||
// if (userType == UserType.SYS_USER) {
|
||||
// return new ArrayList<>(loginUser.getMenuPermission());
|
||||
// } else if (userType == UserType.APP_USER) {
|
||||
// // 其他端 自行根据业务编写
|
||||
// }
|
||||
// return new ArrayList<>();
|
||||
return Collections.singletonList("*");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.bidding.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.bidding.domain.vo.BusBiddingLimitListVo;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
||||
import org.dromara.bidding.service.IBusBiddingLimitListService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成本-投标
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bidding/biddingLimitList")
|
||||
public class BusBiddingLimitListController extends BaseController {
|
||||
|
||||
private final IBusBiddingLimitListService busBiddingLimitListService;
|
||||
|
||||
/**
|
||||
* 查询成本-投标列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusBiddingLimitListVo> list(BusBiddingLimitListBo bo, PageQuery pageQuery) {
|
||||
return busBiddingLimitListService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成本-投标列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:export")
|
||||
@Log(title = "成本-投标", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusBiddingLimitListBo bo, HttpServletResponse response) {
|
||||
List<BusBiddingLimitListVo> list = busBiddingLimitListService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "成本-投标", BusBiddingLimitListVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成本-投标详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusBiddingLimitListVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busBiddingLimitListService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本-投标
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:add")
|
||||
@Log(title = "成本-投标", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBiddingLimitListBo bo) {
|
||||
return toAjax(busBiddingLimitListService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本-投标
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:edit")
|
||||
@Log(title = "成本-投标", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBiddingLimitListBo bo) {
|
||||
return toAjax(busBiddingLimitListService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成本-投标
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingLimitList:remove")
|
||||
@Log(title = "成本-投标", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBiddingLimitListService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.bidding.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.bidding.domain.vo.BusBiddingUserVo;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingUserBo;
|
||||
import org.dromara.bidding.service.IBusBiddingUserService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 招投标人员
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bidding/biddingUser")
|
||||
public class BusBiddingUserController extends BaseController {
|
||||
|
||||
private final IBusBiddingUserService busBiddingUserService;
|
||||
|
||||
/**
|
||||
* 查询招投标人员列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusBiddingUserVo> list(BusBiddingUserBo bo, PageQuery pageQuery) {
|
||||
return busBiddingUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出招投标人员列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:export")
|
||||
@Log(title = "招投标人员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusBiddingUserBo bo, HttpServletResponse response) {
|
||||
List<BusBiddingUserVo> list = busBiddingUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "招投标人员", BusBiddingUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取招投标人员详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusBiddingUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busBiddingUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招投标人员
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:add")
|
||||
@Log(title = "招投标人员", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBiddingUserBo bo) {
|
||||
return toAjax(busBiddingUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招投标人员
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:edit")
|
||||
@Log(title = "招投标人员", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBiddingUserBo bo) {
|
||||
return toAjax(busBiddingUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除招投标人员
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bidding:biddingUser:remove")
|
||||
@Log(title = "招投标人员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBiddingUserService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.bidding.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.bidding.domain.vo.BusListOfWinningBidsVo;
|
||||
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
||||
import org.dromara.bidding.service.IBusListOfWinningBidsService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 中标项目一览
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bidding/listOfWinningBids")
|
||||
public class BusListOfWinningBidsController extends BaseController {
|
||||
|
||||
private final IBusListOfWinningBidsService busListOfWinningBidsService;
|
||||
|
||||
/**
|
||||
* 查询中标项目一览列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusListOfWinningBidsVo> list(BusListOfWinningBidsBo bo, PageQuery pageQuery) {
|
||||
return busListOfWinningBidsService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出中标项目一览列表
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:export")
|
||||
@Log(title = "中标项目一览", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusListOfWinningBidsBo bo, HttpServletResponse response) {
|
||||
List<BusListOfWinningBidsVo> list = busListOfWinningBidsService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "中标项目一览", BusListOfWinningBidsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中标项目一览详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusListOfWinningBidsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busListOfWinningBidsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增中标项目一览
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:add")
|
||||
@Log(title = "中标项目一览", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusListOfWinningBidsBo bo) {
|
||||
return toAjax(busListOfWinningBidsService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改中标项目一览
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:edit")
|
||||
@Log(title = "中标项目一览", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusListOfWinningBidsBo bo) {
|
||||
return toAjax(busListOfWinningBidsService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除中标项目一览
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bidding:listOfWinningBids:remove")
|
||||
@Log(title = "中标项目一览", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busListOfWinningBidsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package org.dromara.bidding.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_bidding_limit_list
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_bidding_limit_list")
|
||||
public class BusBiddingLimitList extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String versions;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String sheet;
|
||||
|
||||
/**
|
||||
* 子ID
|
||||
*/
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private Long unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package org.dromara.bidding.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_bidding_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_bidding_user")
|
||||
public class BusBiddingUser extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 招投标人员id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 招投标人员姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package org.dromara.bidding.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_list_of_winning_bids
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_list_of_winning_bids")
|
||||
public class BusListOfWinningBids extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 中标价(原币)
|
||||
*/
|
||||
private Long winningBidOriginal;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private Long exchangeRate;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 所属主体
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* 中标价
|
||||
*/
|
||||
private Long winningBid;
|
||||
|
||||
/**
|
||||
* 中标日期
|
||||
*/
|
||||
private Date bidWinningDate;
|
||||
|
||||
/**
|
||||
* 投标保证金
|
||||
*/
|
||||
private Long bidDeposit;
|
||||
|
||||
/**
|
||||
* 是否退还
|
||||
*/
|
||||
private String whetherSendBack;
|
||||
|
||||
/**
|
||||
* 建设单位(客户)
|
||||
*/
|
||||
private String construction;
|
||||
|
||||
/**
|
||||
* 总造价
|
||||
*/
|
||||
private Long totalCost;
|
||||
|
||||
/**
|
||||
* 立项申请人
|
||||
*/
|
||||
private String projectApplicant;
|
||||
|
||||
/**
|
||||
* 立项部门
|
||||
*/
|
||||
private String projectApplicantDept;
|
||||
|
||||
/**
|
||||
* 立项申请日期
|
||||
*/
|
||||
private Date projectApplicantTime;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String projectNumbering;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package org.dromara.bidding.domain.bo;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||
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_bidding_limit_list
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusBiddingLimitList.class, reverseConvertGenerate = false)
|
||||
public class BusBiddingLimitListBo 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 versions;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String sheet;
|
||||
|
||||
/**
|
||||
* 子ID
|
||||
*/
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private Long unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package org.dromara.bidding.domain.bo;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingUser;
|
||||
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_bidding_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusBiddingUser.class, reverseConvertGenerate = false)
|
||||
public class BusBiddingUserBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 招投标人员id
|
||||
*/
|
||||
@NotNull(message = "招投标人员id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 招投标人员姓名
|
||||
*/
|
||||
@NotBlank(message = "招投标人员姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package org.dromara.bidding.domain.bo;
|
||||
|
||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||
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_list_of_winning_bids
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusListOfWinningBids.class, reverseConvertGenerate = false)
|
||||
public class BusListOfWinningBidsBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 中标价(原币)
|
||||
*/
|
||||
private Long winningBidOriginal;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private Long exchangeRate;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 所属主体
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* 中标价
|
||||
*/
|
||||
private Long winningBid;
|
||||
|
||||
/**
|
||||
* 中标日期
|
||||
*/
|
||||
private Date bidWinningDate;
|
||||
|
||||
/**
|
||||
* 投标保证金
|
||||
*/
|
||||
private Long bidDeposit;
|
||||
|
||||
/**
|
||||
* 是否退还
|
||||
*/
|
||||
private String whetherSendBack;
|
||||
|
||||
/**
|
||||
* 建设单位(客户)
|
||||
*/
|
||||
private String construction;
|
||||
|
||||
/**
|
||||
* 总造价
|
||||
*/
|
||||
private Long totalCost;
|
||||
|
||||
/**
|
||||
* 立项申请人
|
||||
*/
|
||||
private String projectApplicant;
|
||||
|
||||
/**
|
||||
* 立项部门
|
||||
*/
|
||||
private String projectApplicantDept;
|
||||
|
||||
/**
|
||||
* 立项申请日期
|
||||
*/
|
||||
private Date projectApplicantTime;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String projectNumbering;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package org.dromara.bidding.domain.vo;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||
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_bidding_limit_list
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusBiddingLimitList.class)
|
||||
public class BusBiddingLimitListVo 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 versions;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@ExcelProperty(value = "表名")
|
||||
private String sheet;
|
||||
|
||||
/**
|
||||
* 子ID
|
||||
*/
|
||||
@ExcelProperty(value = "子ID")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
@ExcelProperty(value = "父ID")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ExcelProperty(value = "编号")
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@ExcelProperty(value = "单价")
|
||||
private Long unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.dromara.bidding.domain.vo;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingUser;
|
||||
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_bidding_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusBiddingUser.class)
|
||||
public class BusBiddingUserVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 招投标人员id
|
||||
*/
|
||||
@ExcelProperty(value = "招投标人员id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 招投标人员姓名
|
||||
*/
|
||||
@ExcelProperty(value = "招投标人员姓名")
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package org.dromara.bidding.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||
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_list_of_winning_bids
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusListOfWinningBids.class)
|
||||
public class BusListOfWinningBidsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
@ExcelProperty(value = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 中标价(原币)
|
||||
*/
|
||||
@ExcelProperty(value = "中标价", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "原=币")
|
||||
private Long winningBidOriginal;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
@ExcelProperty(value = "汇率")
|
||||
private Long exchangeRate;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ExcelProperty(value = "币种")
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 所属主体
|
||||
*/
|
||||
@ExcelProperty(value = "所属主体")
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* 中标价
|
||||
*/
|
||||
@ExcelProperty(value = "中标价")
|
||||
private Long winningBid;
|
||||
|
||||
/**
|
||||
* 中标日期
|
||||
*/
|
||||
@ExcelProperty(value = "中标日期")
|
||||
private Date bidWinningDate;
|
||||
|
||||
/**
|
||||
* 投标保证金
|
||||
*/
|
||||
@ExcelProperty(value = "投标保证金")
|
||||
private Long bidDeposit;
|
||||
|
||||
/**
|
||||
* 是否退还
|
||||
*/
|
||||
@ExcelProperty(value = "是否退还")
|
||||
private String whetherSendBack;
|
||||
|
||||
/**
|
||||
* 建设单位(客户)
|
||||
*/
|
||||
@ExcelProperty(value = "建设单位", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "客=户")
|
||||
private String construction;
|
||||
|
||||
/**
|
||||
* 总造价
|
||||
*/
|
||||
@ExcelProperty(value = "总造价")
|
||||
private Long totalCost;
|
||||
|
||||
/**
|
||||
* 立项申请人
|
||||
*/
|
||||
@ExcelProperty(value = "立项申请人")
|
||||
private String projectApplicant;
|
||||
|
||||
/**
|
||||
* 立项部门
|
||||
*/
|
||||
@ExcelProperty(value = "立项部门")
|
||||
private String projectApplicantDept;
|
||||
|
||||
/**
|
||||
* 立项申请日期
|
||||
*/
|
||||
@ExcelProperty(value = "立项申请日期")
|
||||
private Date projectApplicantTime;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@ExcelProperty(value = "流程状态")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
@ExcelProperty(value = "项目编号")
|
||||
private String projectNumbering;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.bidding.mapper;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 成本-投标Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface BusBiddingLimitListMapper extends BaseMapperPlus<BusBiddingLimitList, BusBiddingLimitListVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.bidding.mapper;
|
||||
|
||||
import org.dromara.bidding.domain.BusBiddingUser;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingUserVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 招投标人员Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface BusBiddingUserMapper extends BaseMapperPlus<BusBiddingUser, BusBiddingUserVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.bidding.mapper;
|
||||
|
||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||
import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 中标项目一览Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface BusListOfWinningBidsMapper extends BaseMapperPlus<BusListOfWinningBids, BusListOfWinningBidsVo> {
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.bidding.service;
|
||||
|
||||
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||
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-20
|
||||
*/
|
||||
public interface IBusBiddingLimitListService extends IService<BusBiddingLimitList>{
|
||||
|
||||
/**
|
||||
* 查询成本-投标
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 成本-投标
|
||||
*/
|
||||
BusBiddingLimitListVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询成本-投标列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 成本-投标分页列表
|
||||
*/
|
||||
TableDataInfo<BusBiddingLimitListVo> queryPageList(BusBiddingLimitListBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的成本-投标列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 成本-投标列表
|
||||
*/
|
||||
List<BusBiddingLimitListVo> queryList(BusBiddingLimitListBo bo);
|
||||
|
||||
/**
|
||||
* 新增成本-投标
|
||||
*
|
||||
* @param bo 成本-投标
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusBiddingLimitListBo bo);
|
||||
|
||||
/**
|
||||
* 修改成本-投标
|
||||
*
|
||||
* @param bo 成本-投标
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusBiddingLimitListBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除成本-投标信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.bidding.service;
|
||||
|
||||
import org.dromara.bidding.domain.vo.BusBiddingUserVo;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingUserBo;
|
||||
import org.dromara.bidding.domain.BusBiddingUser;
|
||||
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-20
|
||||
*/
|
||||
public interface IBusBiddingUserService extends IService<BusBiddingUser>{
|
||||
|
||||
/**
|
||||
* 查询招投标人员
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 招投标人员
|
||||
*/
|
||||
BusBiddingUserVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询招投标人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 招投标人员分页列表
|
||||
*/
|
||||
TableDataInfo<BusBiddingUserVo> queryPageList(BusBiddingUserBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的招投标人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 招投标人员列表
|
||||
*/
|
||||
List<BusBiddingUserVo> queryList(BusBiddingUserBo bo);
|
||||
|
||||
/**
|
||||
* 新增招投标人员
|
||||
*
|
||||
* @param bo 招投标人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusBiddingUserBo bo);
|
||||
|
||||
/**
|
||||
* 修改招投标人员
|
||||
*
|
||||
* @param bo 招投标人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusBiddingUserBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除招投标人员信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.bidding.service;
|
||||
|
||||
import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
||||
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||
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-20
|
||||
*/
|
||||
public interface IBusListOfWinningBidsService extends IService<BusListOfWinningBids>{
|
||||
|
||||
/**
|
||||
* 查询中标项目一览
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 中标项目一览
|
||||
*/
|
||||
BusListOfWinningBidsVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询中标项目一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 中标项目一览分页列表
|
||||
*/
|
||||
TableDataInfo<BusListOfWinningBidsVo> queryPageList(BusListOfWinningBidsBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的中标项目一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 中标项目一览列表
|
||||
*/
|
||||
List<BusListOfWinningBidsVo> queryList(BusListOfWinningBidsBo bo);
|
||||
|
||||
/**
|
||||
* 新增中标项目一览
|
||||
*
|
||||
* @param bo 中标项目一览
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusListOfWinningBidsBo bo);
|
||||
|
||||
/**
|
||||
* 修改中标项目一览
|
||||
*
|
||||
* @param bo 中标项目一览
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusListOfWinningBidsBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除中标项目一览信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package org.dromara.bidding.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.bidding.domain.bo.BusBiddingLimitListBo;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||
import org.dromara.bidding.mapper.BusBiddingLimitListMapper;
|
||||
import org.dromara.bidding.service.IBusBiddingLimitListService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 成本-投标Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitListMapper, BusBiddingLimitList> implements IBusBiddingLimitListService {
|
||||
|
||||
private final BusBiddingLimitListMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询成本-投标
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 成本-投标
|
||||
*/
|
||||
@Override
|
||||
public BusBiddingLimitListVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询成本-投标列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 成本-投标分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusBiddingLimitListVo> queryPageList(BusBiddingLimitListBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBiddingLimitList> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBiddingLimitListVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的成本-投标列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 成本-投标列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusBiddingLimitListVo> queryList(BusBiddingLimitListBo bo) {
|
||||
LambdaQueryWrapper<BusBiddingLimitList> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusBiddingLimitList> buildQueryWrapper(BusBiddingLimitListBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusBiddingLimitList> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusBiddingLimitList::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusBiddingLimitList::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVersions()), BusBiddingLimitList::getVersions, bo.getVersions());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSheet()), BusBiddingLimitList::getSheet, bo.getSheet());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSid()), BusBiddingLimitList::getSid, bo.getSid());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPid()), BusBiddingLimitList::getPid, bo.getPid());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNum()), BusBiddingLimitList::getNum, bo.getNum());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusBiddingLimitList::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), BusBiddingLimitList::getSpecification, bo.getSpecification());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), BusBiddingLimitList::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getQuantity() != null, BusBiddingLimitList::getQuantity, bo.getQuantity());
|
||||
lqw.eq(bo.getUnitPrice() != null, BusBiddingLimitList::getUnitPrice, bo.getUnitPrice());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本-投标
|
||||
*
|
||||
* @param bo 成本-投标
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusBiddingLimitListBo bo) {
|
||||
BusBiddingLimitList add = MapstructUtils.convert(bo, BusBiddingLimitList.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本-投标
|
||||
*
|
||||
* @param bo 成本-投标
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusBiddingLimitListBo bo) {
|
||||
BusBiddingLimitList update = MapstructUtils.convert(bo, BusBiddingLimitList.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBiddingLimitList 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,133 @@
|
||||
package org.dromara.bidding.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.bidding.domain.bo.BusBiddingUserBo;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingUserVo;
|
||||
import org.dromara.bidding.domain.BusBiddingUser;
|
||||
import org.dromara.bidding.mapper.BusBiddingUserMapper;
|
||||
import org.dromara.bidding.service.IBusBiddingUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 招投标人员Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusBiddingUserServiceImpl extends ServiceImpl<BusBiddingUserMapper, BusBiddingUser> implements IBusBiddingUserService {
|
||||
|
||||
private final BusBiddingUserMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询招投标人员
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 招投标人员
|
||||
*/
|
||||
@Override
|
||||
public BusBiddingUserVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询招投标人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 招投标人员分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusBiddingUserVo> queryPageList(BusBiddingUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBiddingUser> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBiddingUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的招投标人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 招投标人员列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusBiddingUserVo> queryList(BusBiddingUserBo bo) {
|
||||
LambdaQueryWrapper<BusBiddingUser> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusBiddingUser> buildQueryWrapper(BusBiddingUserBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusBiddingUser> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusBiddingUser::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusBiddingUser::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getUserId() != null, BusBiddingUser::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), BusBiddingUser::getUserName, bo.getUserName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招投标人员
|
||||
*
|
||||
* @param bo 招投标人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusBiddingUserBo bo) {
|
||||
BusBiddingUser add = MapstructUtils.convert(bo, BusBiddingUser.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招投标人员
|
||||
*
|
||||
* @param bo 招投标人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusBiddingUserBo bo) {
|
||||
BusBiddingUser update = MapstructUtils.convert(bo, BusBiddingUser.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBiddingUser 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,148 @@
|
||||
package org.dromara.bidding.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.bidding.domain.bo.BusListOfWinningBidsBo;
|
||||
import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||
import org.dromara.bidding.mapper.BusListOfWinningBidsMapper;
|
||||
import org.dromara.bidding.service.IBusListOfWinningBidsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 中标项目一览Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusListOfWinningBidsServiceImpl extends ServiceImpl<BusListOfWinningBidsMapper, BusListOfWinningBids> implements IBusListOfWinningBidsService {
|
||||
|
||||
private final BusListOfWinningBidsMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询中标项目一览
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 中标项目一览
|
||||
*/
|
||||
@Override
|
||||
public BusListOfWinningBidsVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询中标项目一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 中标项目一览分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusListOfWinningBidsVo> queryPageList(BusListOfWinningBidsBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusListOfWinningBids> lqw = buildQueryWrapper(bo);
|
||||
Page<BusListOfWinningBidsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的中标项目一览列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 中标项目一览列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusListOfWinningBidsVo> queryList(BusListOfWinningBidsBo bo) {
|
||||
LambdaQueryWrapper<BusListOfWinningBids> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusListOfWinningBids> buildQueryWrapper(BusListOfWinningBidsBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusListOfWinningBids> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusListOfWinningBids::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusListOfWinningBids::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectStatus()), BusListOfWinningBids::getProjectStatus, bo.getProjectStatus());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProjectName()), BusListOfWinningBids::getProjectName, bo.getProjectName());
|
||||
lqw.eq(bo.getWinningBidOriginal() != null, BusListOfWinningBids::getWinningBidOriginal, bo.getWinningBidOriginal());
|
||||
lqw.eq(bo.getExchangeRate() != null, BusListOfWinningBids::getExchangeRate, bo.getExchangeRate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCurrency()), BusListOfWinningBids::getCurrency, bo.getCurrency());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSubject()), BusListOfWinningBids::getSubject, bo.getSubject());
|
||||
lqw.eq(bo.getWinningBid() != null, BusListOfWinningBids::getWinningBid, bo.getWinningBid());
|
||||
lqw.eq(bo.getBidWinningDate() != null, BusListOfWinningBids::getBidWinningDate, bo.getBidWinningDate());
|
||||
lqw.eq(bo.getBidDeposit() != null, BusListOfWinningBids::getBidDeposit, bo.getBidDeposit());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWhetherSendBack()), BusListOfWinningBids::getWhetherSendBack, bo.getWhetherSendBack());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getConstruction()), BusListOfWinningBids::getConstruction, bo.getConstruction());
|
||||
lqw.eq(bo.getTotalCost() != null, BusListOfWinningBids::getTotalCost, bo.getTotalCost());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectApplicant()), BusListOfWinningBids::getProjectApplicant, bo.getProjectApplicant());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectApplicantDept()), BusListOfWinningBids::getProjectApplicantDept, bo.getProjectApplicantDept());
|
||||
lqw.eq(bo.getProjectApplicantTime() != null, BusListOfWinningBids::getProjectApplicantTime, bo.getProjectApplicantTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()), BusListOfWinningBids::getProcessStatus, bo.getProcessStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectNumbering()), BusListOfWinningBids::getProjectNumbering, bo.getProjectNumbering());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增中标项目一览
|
||||
*
|
||||
* @param bo 中标项目一览
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusListOfWinningBidsBo bo) {
|
||||
BusListOfWinningBids add = MapstructUtils.convert(bo, BusListOfWinningBids.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改中标项目一览
|
||||
*
|
||||
* @param bo 中标项目一览
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusListOfWinningBidsBo bo) {
|
||||
BusListOfWinningBids update = MapstructUtils.convert(bo, BusListOfWinningBids.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusListOfWinningBids entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除中标项目一览信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -15,6 +15,8 @@ import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
@ -24,6 +26,10 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -48,6 +54,9 @@ public class BusPurchaseDocController extends BaseController {
|
||||
|
||||
private final IBusPlanDocAssociationService planDocAssociationService;
|
||||
|
||||
private final IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||
|
||||
private final IBusBillofquantitiesService busBillofquantitiesService;
|
||||
/**
|
||||
* 查询物资-采购联系单列表
|
||||
*/
|
||||
@ -91,6 +100,18 @@ public class BusPurchaseDocController extends BaseController {
|
||||
return R.ok(busPurchaseDocService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-采购联系单详细信息图片
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:querPic")
|
||||
@GetMapping("/pic/{id}")
|
||||
public R<String> getPic(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok("操作成功", busPurchaseDocService.queryPicBase64ById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-采购联系单
|
||||
*/
|
||||
@ -143,4 +164,28 @@ public class BusPurchaseDocController extends BaseController {
|
||||
bo.setIds(list1);
|
||||
return R.ok(materialbatchdemandplanService.queryList(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取工程量清单列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
||||
@GetMapping("/engineeringList")
|
||||
public R<List<BusBillofquantities>> obtainTheList(Long projectId) {
|
||||
|
||||
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
.last("limit 1")
|
||||
);
|
||||
if (one == null){
|
||||
throw new ServiceException("请先完成物资工程量清单");
|
||||
}
|
||||
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
||||
.eq(BusBillofquantities::getVersions, one.getVersions())
|
||||
);
|
||||
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/8 11:15
|
||||
@ -10,5 +15,23 @@ public class constant {
|
||||
public static final String MaterialsPlans = "materialsPlans"; //计划
|
||||
public static final String BatchRequirements = "batchRequirements"; //需求
|
||||
public static final String EquipmentOrdering = "equipmentOrdering"; //订货
|
||||
public static final String PURCHASE_DOC_FILE_URL = "docs/purchase/doc/"; // 采购联系单文件路径
|
||||
public static final String PURCHASE_DOC_TEMPLATE_PATH = "template/物资采购联系单模版.docx"; // 采购联系单文件路径
|
||||
public static final String SUPPLIER_INPUT = "supplierInput";//供应商入库
|
||||
|
||||
/**
|
||||
* 获取物资采购联系单文件名
|
||||
*/
|
||||
public static String getBusPurchaseDocFileUrl(BusPurchaseDoc purchaseDoc) {
|
||||
String timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(purchaseDoc.getUpdateTime());
|
||||
return String.format("%s%s/%s", PURCHASE_DOC_FILE_URL, purchaseDoc.getId(), timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资采购联系单文件名
|
||||
*/
|
||||
public static String getBusPurchaseDocFileName(BusPurchaseDoc purchaseDoc) {
|
||||
String createDate = DateUtils.formatDate(purchaseDoc.getCreateTime());
|
||||
return String.format("物资采购联系单(%s).docx", createDate);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -87,7 +89,7 @@ public class BusMaterialbatchdemandplan extends BaseEntity {
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
private BigDecimal demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -90,7 +91,7 @@ public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
private BigDecimal demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
|
@ -76,10 +76,25 @@ public interface IBusPurchaseDocService extends IService<BusPurchaseDoc> {
|
||||
*/
|
||||
void create(Long id, HashMap<Long, BigDecimal> map);
|
||||
|
||||
/**
|
||||
* 创建Word
|
||||
*
|
||||
* @param purchaseDoc 采购联系单对象
|
||||
*/
|
||||
void createWord(BusPurchaseDoc purchaseDoc);
|
||||
|
||||
/**
|
||||
* 根据主键导出Word
|
||||
*
|
||||
* @param id 主键id
|
||||
*/
|
||||
void exportWordById(Long id, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 根据主键查询详情图片base64
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 详情图片base64
|
||||
*/
|
||||
String queryPicBase64ById(Long id);
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import jakarta.servlet.ServletOutputStream;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.docx4j.openpackaging.exceptions.Docx4JException;
|
||||
import org.dromara.cailiaoshebei.controller.constant;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
@ -36,21 +36,24 @@ 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;
|
||||
import org.dromara.common.core.utils.file.FileUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.oss.exception.OssException;
|
||||
import org.dromara.common.utils.documentOperations.WordToPdfToImg;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@ -75,6 +78,9 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
|
||||
private final IBusMrpBaseService mrpBaseService;
|
||||
|
||||
private final IBusProjectService projectService;
|
||||
|
||||
private final WordToPdfToImg wordToPdfToImg;
|
||||
|
||||
/**
|
||||
* 查询物资-采购联系单
|
||||
@ -207,7 +213,14 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPurchaseDoc entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
List<BusPurchaseDoc> list = list(Wrappers.lambdaQuery(BusPurchaseDoc.class)
|
||||
.eq(BusPurchaseDoc::getProjectId, entity.getProjectId())
|
||||
.eq(BusPurchaseDoc::getDocCode, entity.getDocCode())
|
||||
.ne(entity.getId() != null, BusPurchaseDoc::getId, entity.getId())
|
||||
);
|
||||
if (!list.isEmpty()) {
|
||||
throw new ServiceException("该项目已存在此采购单编号");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -260,6 +273,62 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
planDocAssociationService.saveBatch(busPlanDocAssociations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建Word
|
||||
*
|
||||
* @param purchaseDoc 采购联系单对象
|
||||
*/
|
||||
@Override
|
||||
public void createWord(BusPurchaseDoc purchaseDoc) {
|
||||
Path targetDir = Paths.get(constant.getBusPurchaseDocFileUrl(purchaseDoc));
|
||||
// 如果存在目录则直接返回,不存在则生成文件并返回
|
||||
if (!Files.exists(targetDir)) {
|
||||
// 清理旧文件
|
||||
String baseUrl = constant.PURCHASE_DOC_FILE_URL + purchaseDoc.getId();
|
||||
try {
|
||||
Path dirPath = Paths.get(baseUrl);
|
||||
if (Files.exists(dirPath)) {
|
||||
FileUtils.deleteDirectory(dirPath);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("文件目录:{},清理失败", baseUrl, e);
|
||||
}
|
||||
// 准备数据
|
||||
List<BusMaterialbatchdemandplan> items = new ArrayList<>();
|
||||
List<BusPlanDocAssociation> planDocAssociationList = planDocAssociationService.lambdaQuery()
|
||||
.eq(BusPlanDocAssociation::getDocId, purchaseDoc.getId())
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(planDocAssociationList)) {
|
||||
List<Long> planIds = planDocAssociationList.stream().map(BusPlanDocAssociation::getPlanId).toList();
|
||||
items = materialbatchdemandplanService.listByIds(planIds);
|
||||
}
|
||||
BusPurchaseDocWordDto data = this.getReplacementDto(purchaseDoc, items);
|
||||
// 生成文件
|
||||
try (InputStream is = getClass().getClassLoader().getResourceAsStream(constant.PURCHASE_DOC_TEMPLATE_PATH)) {
|
||||
if (is == null) {
|
||||
throw new ServiceException("模板文件不存在");
|
||||
}
|
||||
LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
|
||||
Configure config = Configure.builder().bind("items", hackLoopTableRenderPolicy).build();
|
||||
XWPFTemplate template = XWPFTemplate.compile(is, config);
|
||||
template.render(data);
|
||||
// 创建目标目录
|
||||
if (!Files.exists(targetDir)) {
|
||||
Files.createDirectories(targetDir);
|
||||
}
|
||||
// 组合目标文件名
|
||||
String fileName = constant.getBusPurchaseDocFileName(purchaseDoc);
|
||||
// 保存修改后的文件
|
||||
try (FileOutputStream fos = new FileOutputStream(targetDir.resolve(fileName).toFile())) {
|
||||
template.write(fos);
|
||||
}
|
||||
template.close();
|
||||
} catch (IOException e) {
|
||||
throw new OssException("生成Word文件失败,错误信息: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键导出Word
|
||||
*
|
||||
@ -271,38 +340,33 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
if (purchaseDoc == null) {
|
||||
throw new ServiceException("物料领料单不存在");
|
||||
}
|
||||
// 准备数据
|
||||
List<BusMaterialbatchdemandplan> items = new ArrayList<>();
|
||||
List<BusPlanDocAssociation> planDocAssociationList = planDocAssociationService.lambdaQuery()
|
||||
.eq(BusPlanDocAssociation::getDocId, id)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(planDocAssociationList)) {
|
||||
List<Long> planIds = planDocAssociationList.stream().map(BusPlanDocAssociation::getPlanId).toList();
|
||||
items = materialbatchdemandplanService.listByIds(planIds);
|
||||
}
|
||||
BusPurchaseDocWordDto data = this.getReplacementDto(purchaseDoc, items);
|
||||
// 生成文件
|
||||
try (InputStream is = getClass().getClassLoader().getResourceAsStream(constant.PURCHASE_DOC_TEMPLATE_PATH)) {
|
||||
if (is == null) {
|
||||
throw new ServiceException("模板文件不存在");
|
||||
}
|
||||
LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
|
||||
Configure config = Configure.builder().bind("items", hackLoopTableRenderPolicy).build();
|
||||
XWPFTemplate template = XWPFTemplate.compile(is, config);
|
||||
template.render(data);
|
||||
// 创建Word
|
||||
this.createWord(purchaseDoc);
|
||||
}
|
||||
|
||||
// 设置响应头,通知浏览器下载 Word 文件
|
||||
String fileName = URLEncoder.encode("物料领料单_" + id + ".docx", StandardCharsets.UTF_8);
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
||||
try (ServletOutputStream out = response.getOutputStream()) {
|
||||
template.write(out); // 将文件写入响应流
|
||||
out.flush();
|
||||
}
|
||||
template.close();
|
||||
} catch (IOException e) {
|
||||
throw new OssException("生成Word文件失败,错误信息: " + e.getMessage());
|
||||
/**
|
||||
* 根据主键查询详情图片base64
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 详情图片base64
|
||||
*/
|
||||
@Override
|
||||
public String queryPicBase64ById(Long id) {
|
||||
BusPurchaseDoc purchaseDoc = this.getById(id);
|
||||
if (purchaseDoc == null) {
|
||||
throw new ServiceException("物料领料单不存在");
|
||||
}
|
||||
this.createWord(purchaseDoc);
|
||||
String filePath = constant.getBusPurchaseDocFileUrl(purchaseDoc) + "/";
|
||||
String fileName = constant.getBusPurchaseDocFileName(purchaseDoc);
|
||||
File file = new File(filePath + fileName);
|
||||
String base64;
|
||||
try (FileInputStream inputStream = new FileInputStream(file)) {
|
||||
base64 = wordToPdfToImg.wordToImgBase64(inputStream);
|
||||
} catch (IOException | Docx4JException e) {
|
||||
throw new ServiceException("获取物资采购联系单详情失败,错误信息: " + e.getMessage());
|
||||
}
|
||||
return "data:image/png;base64," + base64;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -315,11 +379,14 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
private BusPurchaseDocWordDto getReplacementDto(BusPurchaseDoc purchaseDoc, List<BusMaterialbatchdemandplan> items) {
|
||||
BusPurchaseDocWordDto dto = new BusPurchaseDocWordDto();
|
||||
BeanUtils.copyProperties(purchaseDoc, dto);
|
||||
// 获取项目名称
|
||||
BusProject project = projectService.getById(purchaseDoc.getProjectId());
|
||||
dto.setProjectName(project != null ? project.getProjectName() : "");
|
||||
// 日期转换
|
||||
LocalDate arrivalDate = purchaseDoc.getArrivalDate();
|
||||
dto.setArrivalDate(arrivalDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")));
|
||||
dto.setArrivalDate(arrivalDate != null ? arrivalDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")) : "");
|
||||
LocalDate signingDate = purchaseDoc.getSigningDate();
|
||||
dto.setSigningDate(signingDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")));
|
||||
dto.setSigningDate(signingDate != null ? signingDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")) : "");
|
||||
// 明细项信息
|
||||
if (CollUtil.isNotEmpty(items)) {
|
||||
List<BusMaterialbatchdemandplanWordDto> dtoItems = new ArrayList<>();
|
||||
|
@ -23,4 +23,9 @@ public interface MinioPathConstant {
|
||||
String Formalities = "formalities";
|
||||
//手续附件
|
||||
String FormalitiesAnnex = Formalities +"/annex";
|
||||
|
||||
//招标
|
||||
String Tender = "tender";
|
||||
//供应商入库资料
|
||||
String SupplierInput = Tender+"/supplierInput";
|
||||
}
|
||||
|
@ -144,11 +144,9 @@ public class PdfBoxQrCodeGenerator {
|
||||
*
|
||||
* @param srcPdf 原PDF文件路径(可以是本地路径或网络地址)
|
||||
* @param qrCodeBytes 二维码图片字节数组
|
||||
* @param x X坐标(默认位置)
|
||||
* @param y Y坐标(默认位置)
|
||||
* @return 插入二维码后的PDF文件流
|
||||
*/
|
||||
public static ByteArrayOutputStream addQRCodeToPDFOnAllPages(String srcPdf, byte[] qrCodeBytes, float x, float y)
|
||||
public static ByteArrayOutputStream addQRCodeToPDFOnAllPages(String srcPdf, byte[] qrCodeBytes, boolean isChangeFile)
|
||||
throws IOException, DocumentException {
|
||||
|
||||
PdfReader reader = null;
|
||||
@ -197,21 +195,31 @@ public class PdfBoxQrCodeGenerator {
|
||||
|
||||
float newWidth, newHeight;
|
||||
|
||||
// 判断页面方向:宽度大于高度为横版,否则为竖版
|
||||
if (pageWidth > pageHeight) {
|
||||
// 横版页面:二维码放在右下角
|
||||
qrX = (pageWidth - 90); // 距离右边90点
|
||||
qrY = 24; // 距离底部24点
|
||||
// 如果是变更文件且为第一页,使用特殊位置处理
|
||||
if (isChangeFile && pageNum == 1) {
|
||||
// 变更文件第一页使用传入的坐标参数
|
||||
qrX = (pageWidth - 143);
|
||||
qrY = pageHeight - 213;
|
||||
newWidth = 67;
|
||||
newHeight = 79;
|
||||
} else {
|
||||
// 竖版页面:二维码放在左上角
|
||||
qrX = 226; // 距离左边226点
|
||||
qrY = pageHeight - 185; // 距离顶部185点
|
||||
newWidth = 69;
|
||||
newHeight = 80;
|
||||
} else {
|
||||
// 判断页面方向:宽度大于高度为横版,否则为竖版
|
||||
if (pageWidth > pageHeight) {
|
||||
// 横版页面:二维码放在右下角
|
||||
qrX = (pageWidth - 90); // 距离右边90点
|
||||
qrY = 24; // 距离底部24点
|
||||
newWidth = 67;
|
||||
newHeight = 79;
|
||||
} else {
|
||||
// 竖版页面:二维码放在左上角
|
||||
qrX = 226; // 距离左边226点
|
||||
qrY = pageHeight - 185; // 距离顶部185点
|
||||
newWidth = 69;
|
||||
newHeight = 80;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PdfContentByte content = stamper.getOverContent(pageNum);
|
||||
Image image = Image.getInstance(qrCodeBytes);
|
||||
image.setAbsolutePosition(qrX, qrY); // 坐标:左下角为原点
|
||||
@ -240,27 +248,30 @@ public class PdfBoxQrCodeGenerator {
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String path = "C:\\Users\\YuanJie\\Desktop\\test.pdf";
|
||||
String outputPath = "C:\\Users\\YuanJie\\Desktop\\test1.pdf";
|
||||
|
||||
String params = "http://192.168.110.151:7788/codeDetail?id="+"1957649652924448769";
|
||||
byte[] bytes = PdfBoxQrCodeGenerator.generateQRCodeBytes(params);
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String path = "C:\\Users\\YuanJie\\Desktop\\test.pdf";
|
||||
// String outputPath = "C:\\Users\\YuanJie\\Desktop\\test1.pdf";
|
||||
//
|
||||
// String params = "ID:[" + 11111 + "] finish";
|
||||
// byte[] bytes = PdfBoxQrCodeGenerator.generateQRCodeBytes(params);
|
||||
//
|
||||
// try {
|
||||
// System.out.println("二维码字节大小: " + bytes.length + " 字节");
|
||||
//
|
||||
// // 在每一页添加二维码
|
||||
// PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(path, outputPath, bytes, 450, 700);
|
||||
//
|
||||
// System.out.println("PDF文件已成功生成到: " + outputPath);
|
||||
// System.out.println("生成的PDF大小: " + new File(outputPath).length() + " 字节");
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// System.out.println("图纸管理 => 审核结束,向文件添加二维码失败, 错误");
|
||||
// }
|
||||
// }
|
||||
try {
|
||||
System.out.println("二维码字节大小: " + bytes.length + " 字节");
|
||||
|
||||
// 在每一页添加二维码
|
||||
ByteArrayOutputStream byteArrayOutputStream = PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(path, bytes,false);
|
||||
|
||||
// 将输出流写入到指定文件
|
||||
try (FileOutputStream fileOut = new FileOutputStream(outputPath)) {
|
||||
byteArrayOutputStream.writeTo(fileOut);
|
||||
}
|
||||
|
||||
System.out.println("PDF文件已成功生成到: " + outputPath);
|
||||
System.out.println("生成的PDF大小: " + new File(outputPath).length() + " 字节");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("图纸管理 => 审核结束,向文件添加二维码失败, 错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
import static org.dromara.common.constant.MinioPathConstant.ContactNotice;
|
||||
@ -33,16 +31,18 @@ public class WordToPdfToImg {
|
||||
/**
|
||||
* wordToImg 根据file生成缩略图(路径)
|
||||
*
|
||||
* @param file 文件
|
||||
* @param file 文件
|
||||
* @param filePath 文件路径
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
public String wordToImg(MultipartFile file) throws Docx4JException, IOException {
|
||||
String mergedPath = "output/merged.png";
|
||||
public String wordToImg(InputStream file, String filePath, String fileName) throws Docx4JException, IOException {
|
||||
String mergedPath = filePath + "/" + fileName + ".png";
|
||||
// ✅ 1. Word → PDF(内存)
|
||||
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
|
||||
// 直接走路径
|
||||
// WordprocessingMLPackage wordML = WordprocessingMLPackage.load(new File(docxPath));
|
||||
// 直接走文件,word不落地
|
||||
WordprocessingMLPackage wordML = WordprocessingMLPackage.load(file.getInputStream());
|
||||
WordprocessingMLPackage wordML = WordprocessingMLPackage.load(file);
|
||||
Docx4J.toPDF(wordML, pdfOut);
|
||||
// ✅ 2. PDF → 各页 PNG
|
||||
List<BufferedImage> pages = new ArrayList<>();
|
||||
@ -73,6 +73,62 @@ public class WordToPdfToImg {
|
||||
return mergedPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* wordToImg 根据 InputStream 生成缩略图(Base64)
|
||||
*
|
||||
* @param file word 文件流
|
||||
* @return base64 图片字符串(png 格式)
|
||||
*/
|
||||
public String wordToImgBase64(InputStream file) throws Docx4JException, IOException {
|
||||
// ✅ 1. Word → PDF(内存)
|
||||
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
|
||||
WordprocessingMLPackage wordML = WordprocessingMLPackage.load(file);
|
||||
Docx4J.toPDF(wordML, pdfOut);
|
||||
|
||||
// ✅ 2. PDF → 各页 PNG
|
||||
List<BufferedImage> pages = new ArrayList<>();
|
||||
try (PDDocument pdf = PDDocument.load(new ByteArrayInputStream(pdfOut.toByteArray()))) {
|
||||
PDFRenderer renderer = new PDFRenderer(pdf);
|
||||
for (int i = 0; i < pdf.getNumberOfPages(); i++) {
|
||||
BufferedImage img = renderer.renderImageWithDPI(i, 144); // 144 DPI,清晰度可调
|
||||
pages.add(img);
|
||||
}
|
||||
}
|
||||
|
||||
// ✅ 3. 合成所有页为一张长图
|
||||
int totalHeight = pages.stream().mapToInt(BufferedImage::getHeight).sum();
|
||||
int maxWidth = pages.stream().mapToInt(BufferedImage::getWidth).max().orElse(0);
|
||||
BufferedImage merged = new BufferedImage(maxWidth, totalHeight, BufferedImage.TYPE_INT_RGB);
|
||||
|
||||
Graphics2D g = merged.createGraphics();
|
||||
g.setColor(Color.WHITE);
|
||||
g.fillRect(0, 0, maxWidth, totalHeight);
|
||||
|
||||
int y = 0;
|
||||
for (BufferedImage img : pages) {
|
||||
g.drawImage(img, 0, y, null);
|
||||
y += img.getHeight();
|
||||
}
|
||||
g.dispose();
|
||||
|
||||
// ✅ 4. 转换为 Base64
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ImageIO.write(merged, "png", out);
|
||||
byte[] bytes = out.toByteArray();
|
||||
|
||||
return Base64.getEncoder().encodeToString(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* wordToImg 根据file生成缩略图(路径)
|
||||
*
|
||||
* @param file 文件
|
||||
* @param filePath 文件路径
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
public String wordToImg(MultipartFile file, String filePath, String fileName) throws Docx4JException, IOException {
|
||||
return this.wordToImg(file.getInputStream(), filePath, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* convertWordToImage 根据MultipartFile转成缩略图 并上传至minio
|
||||
|
@ -0,0 +1,119 @@
|
||||
package org.dromara.ctr.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.dromara.ctr.domain.bo.CtrFileBo;
|
||||
import org.dromara.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
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.ctr.domain.vo.CtrExpensesContractVo;
|
||||
import org.dromara.ctr.domain.bo.CtrExpensesContractBo;
|
||||
import org.dromara.ctr.service.ICtrExpensesContractService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 支出合同
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ctr/expensesContract")
|
||||
public class CtrExpensesContractController extends BaseController {
|
||||
|
||||
private final ICtrExpensesContractService ctrExpensesContractService;
|
||||
|
||||
private final ICtrFileService fileService;
|
||||
|
||||
/**
|
||||
* 查询支出合同列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CtrExpensesContractVo> list(CtrExpensesContractBo bo, PageQuery pageQuery) {
|
||||
return ctrExpensesContractService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出支出合同列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:export")
|
||||
@Log(title = "支出合同", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CtrExpensesContractBo bo, HttpServletResponse response) {
|
||||
List<CtrExpensesContractVo> list = ctrExpensesContractService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "支出合同", CtrExpensesContractVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支出合同详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CtrExpensesContractVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(ctrExpensesContractService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增支出合同
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:add")
|
||||
@Log(title = "支出合同", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CtrExpensesContractBo bo) {
|
||||
return toAjax(ctrExpensesContractService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支出合同
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:edit")
|
||||
@Log(title = "支出合同", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CtrExpensesContractBo bo) {
|
||||
return toAjax(ctrExpensesContractService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除支出合同
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:remove")
|
||||
@Log(title = "支出合同", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(ctrExpensesContractService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:expensesContract:query")
|
||||
@GetMapping("/file/list")
|
||||
public TableDataInfo<CtrFileVo> list(CtrFileBo bo, PageQuery pageQuery) {
|
||||
return fileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.ctr.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.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.ctr.domain.bo.CtrFileBo;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 合同附件
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ctr/file")
|
||||
public class CtrFileController extends BaseController {
|
||||
|
||||
private final ICtrFileService ctrFileService;
|
||||
|
||||
/**
|
||||
* 查询合同附件列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CtrFileVo> list(CtrFileBo bo, PageQuery pageQuery) {
|
||||
return ctrFileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出合同附件列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:export")
|
||||
@Log(title = "合同附件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CtrFileBo bo, HttpServletResponse response) {
|
||||
List<CtrFileVo> list = ctrFileService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "合同附件", CtrFileVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同附件详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CtrFileVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(ctrFileService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同附件
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:add")
|
||||
@Log(title = "合同附件", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CtrFileBo bo) {
|
||||
return toAjax(ctrFileService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同附件
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:edit")
|
||||
@Log(title = "合同附件", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CtrFileBo bo) {
|
||||
return toAjax(ctrFileService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同附件
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ctr:file:remove")
|
||||
@Log(title = "合同附件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(ctrFileService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package org.dromara.ctr.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.dromara.ctr.domain.bo.CtrFileBo;
|
||||
import org.dromara.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
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.ctr.domain.vo.CtrIncomeContractVo;
|
||||
import org.dromara.ctr.domain.bo.CtrIncomeContractBo;
|
||||
import org.dromara.ctr.service.ICtrIncomeContractService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 收入合同
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ctr/incomeContract")
|
||||
public class CtrIncomeContractController extends BaseController {
|
||||
|
||||
private final ICtrIncomeContractService ctrIncomeContractService;
|
||||
|
||||
private final ICtrFileService fileService;
|
||||
|
||||
/**
|
||||
* 查询收入合同列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CtrIncomeContractVo> list(CtrIncomeContractBo bo, PageQuery pageQuery) {
|
||||
return ctrIncomeContractService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出收入合同列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:export")
|
||||
@Log(title = "收入合同", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CtrIncomeContractBo bo, HttpServletResponse response) {
|
||||
List<CtrIncomeContractVo> list = ctrIncomeContractService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "收入合同", CtrIncomeContractVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收入合同详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CtrIncomeContractVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(ctrIncomeContractService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收入合同
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:add")
|
||||
@Log(title = "收入合同", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CtrIncomeContractBo bo) {
|
||||
return toAjax(ctrIncomeContractService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收入合同
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:edit")
|
||||
@Log(title = "收入合同", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CtrIncomeContractBo bo) {
|
||||
return toAjax(ctrIncomeContractService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收入合同
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:remove")
|
||||
@Log(title = "收入合同", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(ctrIncomeContractService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*/
|
||||
@SaCheckPermission("ctr:incomeContract:query")
|
||||
@GetMapping("/file/list")
|
||||
public TableDataInfo<CtrFileVo> list(CtrFileBo bo, PageQuery pageQuery) {
|
||||
return fileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package org.dromara.ctr.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 支出合同对象 ctr_expenses_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ctr_expenses_contract")
|
||||
public class CtrExpensesContract extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String contractSupplier;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 招标Id
|
||||
*/
|
||||
private Long tenderId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.dromara.ctr.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 合同附件对象 ctr_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ctr_file")
|
||||
public class CtrFile extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package org.dromara.ctr.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 收入合同对象 ctr_income_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ctr_income_contract")
|
||||
public class CtrIncomeContract extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 业主单位
|
||||
*/
|
||||
private String contractOwner;
|
||||
|
||||
/**
|
||||
* 承包内容
|
||||
*/
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package org.dromara.ctr.domain.bo;
|
||||
|
||||
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||
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.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支出合同业务对象 ctr_expenses_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CtrExpensesContract.class, reverseConvertGenerate = false)
|
||||
public class CtrExpensesContractBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotNull(message = "项目ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String contractSupplier;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 招标Id
|
||||
*/
|
||||
private Long tenderId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private List<CtrFileBo> fileList;
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.ctr.domain.bo;
|
||||
|
||||
import org.dromara.ctr.domain.CtrFile;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 合同附件业务对象 ctr_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CtrFile.class, reverseConvertGenerate = false)
|
||||
public class CtrFileBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@NotBlank(message = "文件名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@NotBlank(message = "文件地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
@NotNull(message = "文件ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package org.dromara.ctr.domain.bo;
|
||||
|
||||
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||
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.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收入合同业务对象 ctr_income_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CtrIncomeContract.class, reverseConvertGenerate = false)
|
||||
public class CtrIncomeContractBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotNull(message = "项目ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 业主单位
|
||||
*/
|
||||
private String contractOwner;
|
||||
|
||||
/**
|
||||
* 承包内容
|
||||
*/
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private List<CtrFileBo> fileList;
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package org.dromara.ctr.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支出合同视图对象 ctr_expenses_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CtrExpensesContract.class)
|
||||
public class CtrExpensesContractVo 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 contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
@ExcelProperty(value = "合同类型")
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 合同类型名称
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "contractType",other = "expenses_contract_type")
|
||||
private String contractTypeName;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@ExcelProperty(value = "供应商")
|
||||
private String contractSupplier;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
@ExcelProperty(value = "分包内容")
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@ExcelProperty(value = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 招标Id
|
||||
*/
|
||||
@ExcelProperty(value = "招标Id")
|
||||
private Long tenderId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package org.dromara.ctr.domain.vo;
|
||||
|
||||
import org.dromara.ctr.domain.CtrFile;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 合同附件视图对象 ctr_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CtrFile.class)
|
||||
public class CtrFileVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
@ExcelProperty(value = "合同ID")
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@ExcelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@ExcelProperty(value = "文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
@ExcelProperty(value = "文件ID")
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package org.dromara.ctr.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 收入合同视图对象 ctr_income_contract
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CtrIncomeContract.class)
|
||||
public class CtrIncomeContractVo 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 contractCode;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
@ExcelProperty(value = "合同类型")
|
||||
private String contractType;
|
||||
|
||||
|
||||
/**
|
||||
* 合同类型名称
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "contractType",other = "income_contract_type")
|
||||
private String contractTypeName;
|
||||
|
||||
/**
|
||||
* 业主单位
|
||||
*/
|
||||
@ExcelProperty(value = "业主单位")
|
||||
private String contractOwner;
|
||||
|
||||
/**
|
||||
* 承包内容
|
||||
*/
|
||||
@ExcelProperty(value = "承包内容")
|
||||
private String contractedContent;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@ExcelProperty(value = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 预付款比例
|
||||
*/
|
||||
private BigDecimal advancePayRatio;
|
||||
|
||||
/**
|
||||
* 尾款比例
|
||||
*/
|
||||
private BigDecimal balancePayRatio;
|
||||
|
||||
/**
|
||||
* 质保金比例
|
||||
*/
|
||||
private BigDecimal assuranceDepositRatio;
|
||||
|
||||
/**
|
||||
* 付款类型 1-月结算 2-形象节点
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 付款比例
|
||||
*/
|
||||
private BigDecimal payRatio;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.ctr.mapper;
|
||||
|
||||
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||
import org.dromara.ctr.domain.vo.CtrExpensesContractVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 支出合同Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface CtrExpensesContractMapper extends BaseMapperPlus<CtrExpensesContract, CtrExpensesContractVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.ctr.mapper;
|
||||
|
||||
import org.dromara.ctr.domain.CtrFile;
|
||||
import org.dromara.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 合同附件Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface CtrFileMapper extends BaseMapperPlus<CtrFile, CtrFileVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.ctr.mapper;
|
||||
|
||||
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||
import org.dromara.ctr.domain.vo.CtrIncomeContractVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 收入合同Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface CtrIncomeContractMapper extends BaseMapperPlus<CtrIncomeContract, CtrIncomeContractVo> {
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.ctr.service;
|
||||
|
||||
import org.dromara.ctr.domain.vo.CtrExpensesContractVo;
|
||||
import org.dromara.ctr.domain.bo.CtrExpensesContractBo;
|
||||
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||
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-20
|
||||
*/
|
||||
public interface ICtrExpensesContractService extends IService<CtrExpensesContract>{
|
||||
|
||||
/**
|
||||
* 查询支出合同
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 支出合同
|
||||
*/
|
||||
CtrExpensesContractVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询支出合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 支出合同分页列表
|
||||
*/
|
||||
TableDataInfo<CtrExpensesContractVo> queryPageList(CtrExpensesContractBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的支出合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 支出合同列表
|
||||
*/
|
||||
List<CtrExpensesContractVo> queryList(CtrExpensesContractBo bo);
|
||||
|
||||
/**
|
||||
* 新增支出合同
|
||||
*
|
||||
* @param bo 支出合同
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CtrExpensesContractBo bo);
|
||||
|
||||
/**
|
||||
* 修改支出合同
|
||||
*
|
||||
* @param bo 支出合同
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CtrExpensesContractBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除支出合同信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.ctr.service;
|
||||
|
||||
import org.dromara.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.ctr.domain.bo.CtrFileBo;
|
||||
import org.dromara.ctr.domain.CtrFile;
|
||||
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-20
|
||||
*/
|
||||
public interface ICtrFileService extends IService<CtrFile>{
|
||||
|
||||
/**
|
||||
* 查询合同附件
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 合同附件
|
||||
*/
|
||||
CtrFileVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询合同附件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 合同附件分页列表
|
||||
*/
|
||||
TableDataInfo<CtrFileVo> queryPageList(CtrFileBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的合同附件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 合同附件列表
|
||||
*/
|
||||
List<CtrFileVo> queryList(CtrFileBo bo);
|
||||
|
||||
/**
|
||||
* 新增合同附件
|
||||
*
|
||||
* @param bo 合同附件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CtrFileBo bo);
|
||||
|
||||
/**
|
||||
* 修改合同附件
|
||||
*
|
||||
* @param bo 合同附件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CtrFileBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除合同附件信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.ctr.service;
|
||||
|
||||
import org.dromara.ctr.domain.vo.CtrIncomeContractVo;
|
||||
import org.dromara.ctr.domain.bo.CtrIncomeContractBo;
|
||||
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||
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-20
|
||||
*/
|
||||
public interface ICtrIncomeContractService extends IService<CtrIncomeContract>{
|
||||
|
||||
/**
|
||||
* 查询收入合同
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 收入合同
|
||||
*/
|
||||
CtrIncomeContractVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询收入合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 收入合同分页列表
|
||||
*/
|
||||
TableDataInfo<CtrIncomeContractVo> queryPageList(CtrIncomeContractBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的收入合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 收入合同列表
|
||||
*/
|
||||
List<CtrIncomeContractVo> queryList(CtrIncomeContractBo bo);
|
||||
|
||||
/**
|
||||
* 新增收入合同
|
||||
*
|
||||
* @param bo 收入合同
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CtrIncomeContractBo bo);
|
||||
|
||||
/**
|
||||
* 修改收入合同
|
||||
*
|
||||
* @param bo 收入合同
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CtrIncomeContractBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除收入合同信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package org.dromara.ctr.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.dromara.ctr.domain.CtrFile;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.ctr.domain.bo.CtrExpensesContractBo;
|
||||
import org.dromara.ctr.domain.vo.CtrExpensesContractVo;
|
||||
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||
import org.dromara.ctr.mapper.CtrExpensesContractMapper;
|
||||
import org.dromara.ctr.service.ICtrExpensesContractService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 支出合同Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CtrExpensesContractServiceImpl extends ServiceImpl<CtrExpensesContractMapper, CtrExpensesContract> implements ICtrExpensesContractService {
|
||||
|
||||
private final CtrExpensesContractMapper baseMapper;
|
||||
|
||||
private final ICtrFileService fileService;
|
||||
|
||||
/**
|
||||
* 查询支出合同
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 支出合同
|
||||
*/
|
||||
@Override
|
||||
public CtrExpensesContractVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询支出合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 支出合同分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CtrExpensesContractVo> queryPageList(CtrExpensesContractBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CtrExpensesContract> lqw = buildQueryWrapper(bo);
|
||||
Page<CtrExpensesContractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的支出合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 支出合同列表
|
||||
*/
|
||||
@Override
|
||||
public List<CtrExpensesContractVo> queryList(CtrExpensesContractBo bo) {
|
||||
LambdaQueryWrapper<CtrExpensesContract> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CtrExpensesContract> buildQueryWrapper(CtrExpensesContractBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CtrExpensesContract> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(CtrExpensesContract::getId);
|
||||
lqw.eq(bo.getProjectId() != null, CtrExpensesContract::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), CtrExpensesContract::getContractCode, bo.getContractCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractType()), CtrExpensesContract::getContractType, bo.getContractType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractSupplier()), CtrExpensesContract::getContractSupplier, bo.getContractSupplier());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractedContent()), CtrExpensesContract::getContractedContent, bo.getContractedContent());
|
||||
lqw.eq(bo.getAmount() != null, CtrExpensesContract::getAmount, bo.getAmount());
|
||||
lqw.eq(bo.getTenderId() != null, CtrExpensesContract::getTenderId, bo.getTenderId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增支出合同
|
||||
*
|
||||
* @param bo 支出合同
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CtrExpensesContractBo bo) {
|
||||
CtrExpensesContract add = MapstructUtils.convert(bo, CtrExpensesContract.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
|
||||
if(!bo.getFileList().isEmpty()){
|
||||
List<CtrFile> convert = MapstructUtils.convert(bo.getFileList(), CtrFile.class);
|
||||
convert.forEach(item -> item.setContractId(add.getId()));
|
||||
fileService.saveBatch(convert);
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支出合同
|
||||
*
|
||||
* @param bo 支出合同
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CtrExpensesContractBo bo) {
|
||||
CtrExpensesContract update = MapstructUtils.convert(bo, CtrExpensesContract.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CtrExpensesContract 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,136 @@
|
||||
package org.dromara.ctr.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.ctr.domain.bo.CtrFileBo;
|
||||
import org.dromara.ctr.domain.vo.CtrFileVo;
|
||||
import org.dromara.ctr.domain.CtrFile;
|
||||
import org.dromara.ctr.mapper.CtrFileMapper;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 合同附件Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CtrFileServiceImpl extends ServiceImpl<CtrFileMapper, CtrFile> implements ICtrFileService {
|
||||
|
||||
private final CtrFileMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询合同附件
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 合同附件
|
||||
*/
|
||||
@Override
|
||||
public CtrFileVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询合同附件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 合同附件分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CtrFileVo> queryPageList(CtrFileBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CtrFile> lqw = buildQueryWrapper(bo);
|
||||
Page<CtrFileVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的合同附件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 合同附件列表
|
||||
*/
|
||||
@Override
|
||||
public List<CtrFileVo> queryList(CtrFileBo bo) {
|
||||
LambdaQueryWrapper<CtrFile> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CtrFile> buildQueryWrapper(CtrFileBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CtrFile> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(CtrFile::getId);
|
||||
lqw.eq(bo.getContractId() != null, CtrFile::getContractId, bo.getContractId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), CtrFile::getFileName, bo.getFileName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), CtrFile::getFileUrl, bo.getFileUrl());
|
||||
lqw.eq(bo.getOssId() != null, CtrFile::getOssId, bo.getOssId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同附件
|
||||
*
|
||||
* @param bo 合同附件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CtrFileBo bo) {
|
||||
CtrFile add = MapstructUtils.convert(bo, CtrFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同附件
|
||||
*
|
||||
* @param bo 合同附件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CtrFileBo bo) {
|
||||
CtrFile update = MapstructUtils.convert(bo, CtrFile.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CtrFile 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,145 @@
|
||||
package org.dromara.ctr.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.dromara.ctr.domain.CtrFile;
|
||||
import org.dromara.ctr.service.ICtrFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.ctr.domain.bo.CtrIncomeContractBo;
|
||||
import org.dromara.ctr.domain.vo.CtrIncomeContractVo;
|
||||
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||
import org.dromara.ctr.mapper.CtrIncomeContractMapper;
|
||||
import org.dromara.ctr.service.ICtrIncomeContractService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 收入合同Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CtrIncomeContractServiceImpl extends ServiceImpl<CtrIncomeContractMapper, CtrIncomeContract> implements ICtrIncomeContractService {
|
||||
|
||||
private final CtrIncomeContractMapper baseMapper;
|
||||
|
||||
private final ICtrFileService fileService;
|
||||
|
||||
/**
|
||||
* 查询收入合同
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 收入合同
|
||||
*/
|
||||
@Override
|
||||
public CtrIncomeContractVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询收入合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 收入合同分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CtrIncomeContractVo> queryPageList(CtrIncomeContractBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CtrIncomeContract> lqw = buildQueryWrapper(bo);
|
||||
Page<CtrIncomeContractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的收入合同列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 收入合同列表
|
||||
*/
|
||||
@Override
|
||||
public List<CtrIncomeContractVo> queryList(CtrIncomeContractBo bo) {
|
||||
LambdaQueryWrapper<CtrIncomeContract> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CtrIncomeContract> buildQueryWrapper(CtrIncomeContractBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CtrIncomeContract> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(CtrIncomeContract::getId);
|
||||
lqw.eq(bo.getProjectId() != null, CtrIncomeContract::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), CtrIncomeContract::getContractCode, bo.getContractCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractType()), CtrIncomeContract::getContractType, bo.getContractType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractOwner()), CtrIncomeContract::getContractOwner, bo.getContractOwner());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractedContent()), CtrIncomeContract::getContractedContent, bo.getContractedContent());
|
||||
lqw.eq(bo.getAmount() != null, CtrIncomeContract::getAmount, bo.getAmount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收入合同
|
||||
*
|
||||
* @param bo 收入合同
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CtrIncomeContractBo bo) {
|
||||
CtrIncomeContract add = MapstructUtils.convert(bo, CtrIncomeContract.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if(!bo.getFileList().isEmpty()){
|
||||
List<CtrFile> convert = MapstructUtils.convert(bo.getFileList(), CtrFile.class);
|
||||
convert.forEach(item -> item.setContractId(add.getId()));
|
||||
fileService.saveBatch(convert);
|
||||
}
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收入合同
|
||||
*
|
||||
* @param bo 收入合同
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CtrIncomeContractBo bo) {
|
||||
CtrIncomeContract update = MapstructUtils.convert(bo, CtrIncomeContract.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CtrIncomeContract entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除收入合同信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -1,28 +1,30 @@
|
||||
package org.dromara.design.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
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 jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
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.log.enums.BusinessType;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.design.domain.bo.ImportExcelFileReq;
|
||||
import org.dromara.design.domain.bo.ObtainAllVersionNumbersReq;
|
||||
import org.dromara.design.domain.bo.ObtainTheListReq;
|
||||
import org.dromara.design.domain.bo.SheetListReq;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工程量清单版本
|
||||
*
|
||||
@ -45,7 +47,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/importExcelFile")
|
||||
public R<Void> importExcelFile(ImportExcelFileReq bo, @RequestParam("file") MultipartFile file) throws Exception {
|
||||
return toAjax(busBillofquantitiesVersionsService.importExcelFile(bo,file));
|
||||
return toAjax(busBillofquantitiesVersionsService.importExcelFile(bo, file));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,6 +59,16 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
return busBillofquantitiesVersionsService.obtainAllVersionNumbers(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资设备清单总数据
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:materialTotal")
|
||||
@GetMapping("/materialTotal/{projectId}")
|
||||
public R<List<BusBillofquantitiesMaterialTotalVo>> queryMaterialTotalListByProject(@NotNull(message = "项目主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(busBillofquantitiesVersionsService.queryMaterialTotalListByProject(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定版本的sheet
|
||||
*/
|
||||
@ -85,9 +97,6 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
// * 导入物资设备清单
|
||||
// */
|
||||
|
@ -1,11 +1,13 @@
|
||||
package org.dromara.design.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -14,11 +16,17 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.design.domain.DesVolumeCatalog;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeCreateReq;
|
||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
|
||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
|
||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogQueryReq;
|
||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
|
||||
import org.dromara.design.domain.vo.volumecatalog.DesVolumeCatalogVo;
|
||||
import org.dromara.design.service.IDesDesignChangeService;
|
||||
import org.dromara.design.service.IDesVolumeCatalogService;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -42,6 +50,12 @@ public class DesDesignChangeController extends BaseController {
|
||||
@Resource
|
||||
private IDesDesignChangeService desDesignChangeService;
|
||||
|
||||
@Resource
|
||||
private IDesVolumeCatalogService desVolumeCatalogService;
|
||||
|
||||
@Resource
|
||||
private IDesVolumeFileService desVolumeFileService;
|
||||
|
||||
/**
|
||||
* 查询设计变更管理列表
|
||||
*/
|
||||
@ -108,4 +122,28 @@ public class DesDesignChangeController extends BaseController {
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(desDesignChangeService.deleteByIds(List.of(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询选择卷册目录
|
||||
*/
|
||||
@SaCheckPermission("design:designChange:add")
|
||||
@GetMapping("/catalogList/{projectId}")
|
||||
public R<List<DesVolumeCatalog>> catalogList(@PathVariable("projectId") Long projectId) {
|
||||
return R.ok(desVolumeCatalogService.catalogList(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询选择目录下的蓝图
|
||||
*/
|
||||
@SaCheckPermission("design:designChange:add")
|
||||
@GetMapping("/blueprint/{volumeCatalogId}")
|
||||
public R<List<DesVolumeFile>> blueprint(@PathVariable("volumeCatalogId") Long volumeCatalogId) {
|
||||
List<DesVolumeFile> list = desVolumeFileService.list(Wrappers.lambdaQuery(DesVolumeFile.class)
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, volumeCatalogId)
|
||||
.eq(DesVolumeFile::getType, DesVolumeFile.BLUEPRINT)
|
||||
.eq(DesVolumeFile::getAuditStatus, BusinessStatusEnum.FINISH.getStatus()));
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -107,6 +107,7 @@ public class DesUserController extends BaseController {
|
||||
/**
|
||||
* 批量新增或修改
|
||||
*/
|
||||
@SaCheckPermission("design:user:add")
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/batch")
|
||||
public R<Void> batchAddOrUpdate(@RequestBody DesUserBatchDto dto) {
|
||||
|
@ -75,8 +75,8 @@ public class DesVolumeCatalogController extends BaseController {
|
||||
@SaCheckPermission("design:volumeCatalog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DesVolumeCatalogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(desVolumeCatalogService.queryById(id));
|
||||
@PathVariable Long id,String type) {
|
||||
return R.ok(desVolumeCatalogService.queryById(id,type));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +88,7 @@ public class DesVolumeCatalogController extends BaseController {
|
||||
@GetMapping("/listFileById/{id}")
|
||||
public R<List<DesVolumeFileVo>> listFileById(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
List<DesVolumeFile> volumeFiles = desVolumeCatalogService.queryFileListById(id);
|
||||
List<DesVolumeFile> volumeFiles = desVolumeCatalogService.queryFileListById(id,null);
|
||||
return R.ok(volumeFileService.getVoList(volumeFiles));
|
||||
}
|
||||
|
||||
@ -154,6 +154,7 @@ public class DesVolumeCatalogController extends BaseController {
|
||||
List<DesVolumeCatalogCreateReq> desVolumeCatalogCreateReqs = BeanUtil.copyToList(dataList, DesVolumeCatalogCreateReq.class);
|
||||
for (DesVolumeCatalogCreateReq desVolumeCatalogCreateReq : desVolumeCatalogCreateReqs) {
|
||||
desVolumeCatalogCreateReq.setProjectId(projectId);
|
||||
desVolumeCatalogCreateReq.setDesignState("2");
|
||||
desVolumeCatalogService.insertByBo(desVolumeCatalogCreateReq);
|
||||
}
|
||||
return toAjax(true);
|
||||
@ -174,15 +175,14 @@ public class DesVolumeCatalogController extends BaseController {
|
||||
if (row != null) {
|
||||
String designSubitem = getCellValue(row.getCell(0));
|
||||
String designState = getCellValue(row.getCell(1));
|
||||
String specialty = getCellValue(row.getCell(2));
|
||||
String principal = getCellValue(row.getCell(3));
|
||||
String volumeNumber = getCellValue(row.getCell(4));
|
||||
String documentName = getCellValue(row.getCell(5));
|
||||
LocalDate plannedCompletion = getLocalDateValue(row.getCell(6));
|
||||
// String specialty = getCellValue(row.getCell(2));
|
||||
// String principal = getCellValue(row.getCell(3));
|
||||
String volumeNumber = getCellValue(row.getCell(2));
|
||||
String documentName = getCellValue(row.getCell(3));
|
||||
LocalDate plannedCompletion = getLocalDateValue(row.getCell(4));
|
||||
|
||||
ExcelData excelData = new ExcelData(
|
||||
designSubitem, designState, specialty,
|
||||
principal, volumeNumber, documentName,
|
||||
designSubitem, designState, volumeNumber, documentName,
|
||||
plannedCompletion
|
||||
);
|
||||
dataList.add(excelData);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.design.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -8,8 +9,15 @@ import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.design.domain.bo.DesUserBo;
|
||||
import org.dromara.design.domain.bo.DesVolumeFileBo;
|
||||
import org.dromara.design.domain.dto.volumefile.DesVolumeFileCreateReq;
|
||||
import org.dromara.design.domain.vo.DesUserVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileCodeVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileJoinVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -31,6 +39,18 @@ public class DesVolumeFileController extends BaseController {
|
||||
@Resource
|
||||
private IDesVolumeFileService desVolumeFileService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询卷册文件列表
|
||||
*/
|
||||
// @SaCheckPermission("design:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DesVolumeFileVo> list(DesVolumeFileBo bo, PageQuery pageQuery) {
|
||||
return desVolumeFileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取卷册文件详细信息
|
||||
*
|
||||
@ -67,4 +87,19 @@ public class DesVolumeFileController extends BaseController {
|
||||
return toAjax(desVolumeFileService.deleteByIds(List.of(ids)));
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@GetMapping("/codeInfo")
|
||||
public R<DesVolumeFileCodeVo> getCodeInfo(Long id) {
|
||||
return R.ok(desVolumeFileService.getCodeInfo(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/joinList")
|
||||
public TableDataInfo<DesVolumeFileJoinVo> joinList(DesVolumeFileBo bo, PageQuery pageQuery) {
|
||||
return desVolumeFileService.queryJoinPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -37,5 +37,10 @@ public class DesSubcontract extends BaseEntity {
|
||||
*/
|
||||
private String subContent;
|
||||
|
||||
/**
|
||||
* 分包要求
|
||||
*/
|
||||
private String requirement;
|
||||
|
||||
|
||||
}
|
||||
|
@ -84,4 +84,9 @@ public class DesVolumeCatalog extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
private String opinion;
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,14 @@ public class DesVolumeFile extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
//过程
|
||||
public static final String PROCESS = "1";
|
||||
//蓝图
|
||||
public static final String BLUEPRINT = "3";
|
||||
//废图
|
||||
public static final String WASTE = "4";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@ -58,8 +66,18 @@ public class DesVolumeFile extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
* 图纸类型(1-过程,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
}
|
||||
|
@ -39,4 +39,9 @@ public class DesSubcontractBo extends BaseEntity {
|
||||
private String subContent;
|
||||
|
||||
|
||||
/**
|
||||
* 分包要求
|
||||
*/
|
||||
private String requirement;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
package org.dromara.design.domain.bo;
|
||||
|
||||
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 卷册文件业务对象 des_volume_file
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DesVolumeFile.class, reverseConvertGenerate = false)
|
||||
public class DesVolumeFileBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 卷册目录ID
|
||||
*/
|
||||
@NotNull(message = "卷册目录ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long volumeCatalogId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
@NotNull(message = "文件ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String explain;
|
||||
|
||||
/**
|
||||
* 状态(1正常 2作废)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,2-变更,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
private String volumeNumber;
|
||||
|
||||
/**
|
||||
* 资料名称
|
||||
*/
|
||||
private String documentName;
|
||||
|
||||
}
|
@ -10,18 +10,18 @@ import java.time.LocalDate;
|
||||
public class ExcelData {
|
||||
private String designSubitem;
|
||||
private String designState;
|
||||
private String specialty;
|
||||
private String principal;
|
||||
// private String specialty;
|
||||
// private String principal;
|
||||
private String volumeNumber;
|
||||
private String documentName;
|
||||
private LocalDate plannedCompletion;
|
||||
|
||||
// 构造函数
|
||||
public ExcelData(String designSubitem, String designState, String specialty, String principal, String volumeNumber, String documentName, LocalDate plannedCompletion) {
|
||||
public ExcelData(String designSubitem, String designState, String volumeNumber, String documentName, LocalDate plannedCompletion) {
|
||||
this.designSubitem = designSubitem;
|
||||
this.designState = designState;
|
||||
this.specialty = specialty;
|
||||
this.principal = principal;
|
||||
// this.specialty = specialty;
|
||||
// this.principal = principal;
|
||||
this.volumeNumber = volumeNumber;
|
||||
this.documentName = documentName;
|
||||
this.plannedCompletion = plannedCompletion;
|
||||
@ -44,21 +44,21 @@ public class ExcelData {
|
||||
this.designState = designState;
|
||||
}
|
||||
|
||||
public String getSpecialty() {
|
||||
return specialty;
|
||||
}
|
||||
|
||||
public void setSpecialty(String specialty) {
|
||||
this.specialty = specialty;
|
||||
}
|
||||
|
||||
public String getPrincipal() {
|
||||
return principal;
|
||||
}
|
||||
|
||||
public void setPrincipal(String principal) {
|
||||
this.principal = principal;
|
||||
}
|
||||
// public String getSpecialty() {
|
||||
// return specialty;
|
||||
// }
|
||||
//
|
||||
// public void setSpecialty(String specialty) {
|
||||
// this.specialty = specialty;
|
||||
// }
|
||||
//
|
||||
// public String getPrincipal() {
|
||||
// return principal;
|
||||
// }
|
||||
//
|
||||
// public void setPrincipal(String principal) {
|
||||
// this.principal = principal;
|
||||
// }
|
||||
|
||||
public String getVolumeNumber() {
|
||||
return volumeNumber;
|
||||
|
@ -45,4 +45,7 @@ public class DesDrawingQueryReq implements Serializable {
|
||||
*/
|
||||
private String newest;
|
||||
|
||||
|
||||
private Long volumeCatalogId;
|
||||
|
||||
}
|
||||
|
@ -72,4 +72,9 @@ public class DesVolumeCatalogCreateReq implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
private String opinion;
|
||||
|
||||
}
|
||||
|
@ -38,5 +38,6 @@ public class DesVolumeCatalogQueryReq implements Serializable {
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
@ -63,4 +63,9 @@ public class DesVolumeCatalogUpdateReq implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String opinion;
|
||||
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ public class DesVolumeFileCreateReq implements Serializable {
|
||||
private Long volumeCatalogId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
* 蓝图文件ID
|
||||
*/
|
||||
private List<Long> fileIds;
|
||||
|
||||
/**
|
||||
* 作废文件id列表
|
||||
* 过程文件id列表
|
||||
*/
|
||||
private List<Long> cancellationIds;
|
||||
|
||||
@ -46,4 +46,9 @@ public class DesVolumeFileCreateReq implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,2-变更,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package org.dromara.design.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-19 21:26
|
||||
*/
|
||||
@Data
|
||||
public class BusBillofquantitiesMaterialTotalVo implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -617143782154146988L;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
}
|
@ -71,5 +71,13 @@ public class DesCollectFileVo implements Serializable {
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
}
|
||||
|
@ -46,5 +46,10 @@ public class DesSubcontractVo implements Serializable {
|
||||
@ExcelProperty(value = "分包内容")
|
||||
private String subContent;
|
||||
|
||||
/**
|
||||
* 分包要求
|
||||
*/
|
||||
private String requirement;
|
||||
|
||||
private Date createTime;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -101,7 +102,7 @@ public class DesVolumeCatalogVo implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDate createTime;
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
@ -118,4 +119,9 @@ public class DesVolumeCatalogVo implements Serializable {
|
||||
*/
|
||||
private List<SysUserVo> noViewerList;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
private String opinion;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package org.dromara.design.domain.vo.volumefile;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 卷册文件视图对象 des_volume_file
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DesVolumeFile.class)
|
||||
public class DesVolumeFileCodeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 设计子项
|
||||
*/
|
||||
private String designSubitem;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
private String specialty;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "specialty",other = "des_user_major")
|
||||
private String specialtyName;
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
private String volumeNumber;
|
||||
|
||||
/**
|
||||
* 资料名称
|
||||
*/
|
||||
private String documentName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String principal;
|
||||
|
||||
/**
|
||||
* 设计人员名字
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "principal")
|
||||
private String principalName;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 下载路径
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否最新
|
||||
*/
|
||||
private Boolean isLatest;
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package org.dromara.design.domain.vo.volumefile;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 卷册文件视图对象 des_volume_file
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DesVolumeFile.class)
|
||||
public class DesVolumeFileJoinVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 设计子项
|
||||
*/
|
||||
private String designSubitem;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
private String specialty;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "specialty",other = "des_user_major")
|
||||
private String specialtyName;
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
private String volumeNumber;
|
||||
|
||||
/**
|
||||
* 资料名称
|
||||
*/
|
||||
private String documentName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String principal;
|
||||
|
||||
/**
|
||||
* 设计人员名字
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "principal")
|
||||
private String principalName;
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 卷册目录ID
|
||||
*/
|
||||
private Long volumeCatalogId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String explainText;
|
||||
|
||||
/**
|
||||
* 状态(1正常 2作废)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,2-变更,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
}
|
@ -61,5 +61,19 @@ public class DesVolumeFileVo implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 图纸类型(1-过程,2-变更,3-蓝图,4-作废)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
package org.dromara.design.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.domain.bo.DesVolumeFileBo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileJoinVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
@ -12,4 +17,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface DesVolumeFileMapper extends BaseMapperPlus<DesVolumeFile, DesVolumeFileVo> {
|
||||
|
||||
|
||||
|
||||
Page<DesVolumeFileJoinVo> queryJoinPageList(@Param("page")Page<DesVolumeFileJoinVo> page, @Param("bo")DesVolumeFileBo bo);
|
||||
}
|
||||
|
@ -1,15 +1,14 @@
|
||||
package org.dromara.design.service;
|
||||
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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.*;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
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.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -21,7 +20,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
public interface IBusBillofquantitiesVersionsService extends IService<BusBillofquantitiesVersions>{
|
||||
public interface IBusBillofquantitiesVersionsService extends IService<BusBillofquantitiesVersions> {
|
||||
|
||||
/**
|
||||
* 查询工程量清单版本
|
||||
@ -94,4 +93,11 @@ public interface IBusBillofquantitiesVersionsService extends IService<BusBillofq
|
||||
* 物资设备清单审批详情
|
||||
*/
|
||||
DetailsMaterialAndEquipmentApprovalRes detailsMaterialAndEquipmentApproval(String versions);
|
||||
|
||||
/**
|
||||
* 根据项目 id 获取物资设备清单总数据
|
||||
*
|
||||
* @param projectId 项目id
|
||||
*/
|
||||
List<BusBillofquantitiesMaterialTotalVo> queryMaterialTotalListByProject(Long projectId);
|
||||
}
|
||||
|
@ -110,5 +110,5 @@ public interface IDesDrawingService extends IService<DesDrawing> {
|
||||
* @param volumeFileId 文件id
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
CompletableFuture<Boolean> addQRCodeToPDF(Long volumeFileId);
|
||||
CompletableFuture<Boolean> addQRCodeToPDF(Long volumeFileId,boolean isChangeFile);
|
||||
}
|
||||
|
@ -7,10 +7,12 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.design.domain.DesVolumeCatalog;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.domain.bo.DesVolumeFileBo;
|
||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogCreateReq;
|
||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogQueryReq;
|
||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogUpdateReq;
|
||||
import org.dromara.design.domain.vo.volumecatalog.DesVolumeCatalogVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -29,7 +31,7 @@ public interface IDesVolumeCatalogService extends IService<DesVolumeCatalog> {
|
||||
* @param id 主键
|
||||
* @return 卷册目录
|
||||
*/
|
||||
DesVolumeCatalogVo queryById(Long id);
|
||||
DesVolumeCatalogVo queryById(Long id,String type);
|
||||
|
||||
/**
|
||||
* 分页查询卷册目录列表
|
||||
@ -54,7 +56,7 @@ public interface IDesVolumeCatalogService extends IService<DesVolumeCatalog> {
|
||||
* @param id 卷册目录id
|
||||
* @return 卷册目录文件列表
|
||||
*/
|
||||
List<DesVolumeFile> queryFileListById(Long id);
|
||||
List<DesVolumeFile> queryFileListById(Long id,String type);
|
||||
|
||||
/**
|
||||
* 新增卷册目录
|
||||
@ -86,7 +88,7 @@ public interface IDesVolumeCatalogService extends IService<DesVolumeCatalog> {
|
||||
* @param volumeCatalog 卷册目录
|
||||
* @return 卷册目录封装对象
|
||||
*/
|
||||
DesVolumeCatalogVo getVo(DesVolumeCatalog volumeCatalog);
|
||||
DesVolumeCatalogVo getVo(DesVolumeCatalog volumeCatalog,String type);
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
@ -111,4 +113,11 @@ public interface IDesVolumeCatalogService extends IService<DesVolumeCatalog> {
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean viewerFile(Long id);
|
||||
|
||||
/**
|
||||
* 获取变更单所选择的卷册目录列表
|
||||
*
|
||||
*/
|
||||
List<DesVolumeCatalog> catalogList(Long projectId);
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,13 @@ package org.dromara.design.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.domain.bo.DesVolumeFileBo;
|
||||
import org.dromara.design.domain.dto.volumefile.DesVolumeFileCreateReq;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileCodeVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileJoinVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -64,4 +69,28 @@ public interface IDesVolumeFileService extends IService<DesVolumeFile> {
|
||||
* @return 卷册目录对象视图
|
||||
*/
|
||||
Page<DesVolumeFileVo> getVoPage(Page<DesVolumeFile> volumeFilePage);
|
||||
|
||||
/**
|
||||
* 分页查询卷册文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 卷册文件分页列表
|
||||
*/
|
||||
TableDataInfo<DesVolumeFileVo> queryPageList(DesVolumeFileBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 分页查询卷册文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 卷册文件分页列表
|
||||
*/
|
||||
TableDataInfo<DesVolumeFileJoinVo> queryJoinPageList(DesVolumeFileBo bo, PageQuery pageQuery);
|
||||
|
||||
|
||||
/**
|
||||
* 获取卷册文件详细信息
|
||||
*/
|
||||
DesVolumeFileCodeVo getCodeInfo(Long id);
|
||||
}
|
||||
|
@ -1,10 +1,17 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
@ -13,30 +20,26 @@ import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.excel.coryUtils.ExcelReader;
|
||||
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.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.dromara.common.utils.excel.ExcelDynamicReader;
|
||||
import org.dromara.design.domain.*;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
import org.dromara.design.domain.dto.MaterialsAndEquipmentExcelDto;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
|
||||
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.mapper.BusBillofquantitiesVersionsMapper;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
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.mapper.BusBillofquantitiesVersionsMapper;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -72,7 +75,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
* @return 工程量清单版本
|
||||
*/
|
||||
@Override
|
||||
public BusBillofquantitiesVersionsVo queryById(Long id){
|
||||
public BusBillofquantitiesVersionsVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@ -144,7 +147,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBillofquantitiesVersions entity){
|
||||
private void validEntityBeforeSave(BusBillofquantitiesVersions entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@ -157,7 +160,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
||||
}
|
||||
@ -171,8 +174,8 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
@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){
|
||||
SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(BillOfQuantities, file));
|
||||
if (wordEntity == null) {
|
||||
throw new ServiceException("上传文件失败");
|
||||
}
|
||||
String banBen = BatchNumberGenerator.generateBatchNumber("GCLBB-");
|
||||
@ -182,13 +185,13 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
setProjectId(bo.getProjectId()).
|
||||
setExcelFile(wordEntity.getUrl()));
|
||||
|
||||
if(insert<=0){
|
||||
if (insert <= 0) {
|
||||
throw new RuntimeException("创建版本失败");
|
||||
}
|
||||
//1、获取到解析数据
|
||||
ExcelReader.ExcelData excelData = ExcelReader.readExcelFromMultipartFile(file);
|
||||
//走正常的工程清单
|
||||
if(!Objects.equals(bo.getWorkOrderType(), "3")){
|
||||
if (!Objects.equals(bo.getWorkOrderType(), "3")) {
|
||||
// 2. 解析所有工作表,转换为带父子关系的ExcelMaterial列表 解析所有Sheet数据,按规则生成sid和pid
|
||||
List<BusBillofquantities> allMaterials = new ArrayList<>();
|
||||
for (ExcelReader.SheetData sheetData : excelData.getSheetDataList()) {
|
||||
@ -199,18 +202,18 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
// 存储节点映射:TreeNode → ExcelMaterial(用于子节点关联父节点)
|
||||
Map<ExcelReader.TreeNode, BusBillofquantities> nodeMap = new HashMap<>();
|
||||
// 递归遍历树形结构,生成sid和pid
|
||||
traverseTree(rootNode, nodeMap, allMaterials, sheetName,banBen);
|
||||
traverseTree(rootNode, nodeMap, allMaterials, sheetName, banBen);
|
||||
}
|
||||
// 3. 批量插入数据库
|
||||
for (BusBillofquantities allMaterial : allMaterials) {
|
||||
allMaterial.setProjectId(bo.getProjectId());
|
||||
}
|
||||
boolean b = busBillofquantitiesService.saveBatch(allMaterials);
|
||||
if(!b){
|
||||
if (!b) {
|
||||
throw new RuntimeException("导入失败");
|
||||
}
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
// 跳过1行(表头),读取0到6列(共7列),映射到ExcelData实体类
|
||||
List<MaterialsAndEquipmentExcelDto> dataList = ExcelDynamicReader.readExcel(
|
||||
file, // 上传的文件
|
||||
@ -221,11 +224,11 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
);
|
||||
List<BusBillofquantities> busBillofquantities = BeanUtil.copyToList(dataList, BusBillofquantities.class);
|
||||
for (BusBillofquantities busBillofquantity : busBillofquantities) {
|
||||
busBillofquantity.setProjectId(bo.getProjectId());
|
||||
busBillofquantity.setVersions(banBen);
|
||||
busBillofquantity.setProjectId(bo.getProjectId());
|
||||
busBillofquantity.setVersions(banBen);
|
||||
}
|
||||
boolean b = busBillofquantitiesService.saveBatch(busBillofquantities);
|
||||
if(!b){
|
||||
if (!b) {
|
||||
throw new RuntimeException("导入失败");
|
||||
}
|
||||
return true;
|
||||
@ -241,7 +244,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// sheet为空表示不走下面的代码
|
||||
if(StringUtils.isBlank(bo.getSheet())){
|
||||
if (StringUtils.isBlank(bo.getSheet())) {
|
||||
return flatList;
|
||||
}
|
||||
// 2. 构建父子映射:key=父节点pid,value=该父节点的所有子节点
|
||||
@ -259,12 +262,12 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
DetailsMaterialAndEquipmentApprovalRes detailsMaterialAndEquipmentApprovalRes = new DetailsMaterialAndEquipmentApprovalRes();
|
||||
//根据版本号获取数据
|
||||
BusBillofquantitiesVersions busBillofquantitiesVersions = baseMapper.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>().eq(BusBillofquantitiesVersions::getVersions, versions));
|
||||
if(busBillofquantitiesVersions==null){
|
||||
if (busBillofquantitiesVersions == null) {
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
//根据版本号获取物资设备清单
|
||||
List<BusBillofquantities> busBillofquantities = busBillofquantitiesService.list(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getVersions, versions));
|
||||
if(busBillofquantities==null){
|
||||
if (busBillofquantities == null) {
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
detailsMaterialAndEquipmentApprovalRes.setVersions(busBillofquantitiesVersions.getVersions());
|
||||
@ -273,9 +276,50 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
return detailsMaterialAndEquipmentApprovalRes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目 id 获取物资设备清单总数据
|
||||
*
|
||||
* @param projectId 项目id
|
||||
*/
|
||||
@Override
|
||||
public List<BusBillofquantitiesMaterialTotalVo> queryMaterialTotalListByProject(Long projectId) {
|
||||
List<BusBillofquantitiesVersions> billofquantitiesVersionsList = this.lambdaQuery()
|
||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3")
|
||||
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
.list();
|
||||
if (CollUtil.isEmpty(billofquantitiesVersionsList)) {
|
||||
return List.of();
|
||||
}
|
||||
Set<String> versions = billofquantitiesVersionsList.stream()
|
||||
.map(BusBillofquantitiesVersions::getVersions).collect(Collectors.toSet());
|
||||
List<BusBillofquantities> billofquantitiesList = busBillofquantitiesService.lambdaQuery()
|
||||
.eq(BusBillofquantities::getProjectId, projectId)
|
||||
.in(BusBillofquantities::getVersions, versions)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(billofquantitiesList)) {
|
||||
return List.of();
|
||||
}
|
||||
List<BusBillofquantitiesMaterialTotalVo> list = new ArrayList<>();
|
||||
Map<String, List<BusBillofquantities>> map = billofquantitiesList.stream().collect(Collectors.groupingBy(BusBillofquantities::getName));
|
||||
for (Map.Entry<String, List<BusBillofquantities>> entry : map.entrySet()) {
|
||||
BusBillofquantitiesMaterialTotalVo vo = new BusBillofquantitiesMaterialTotalVo();
|
||||
String key = entry.getKey();
|
||||
List<BusBillofquantities> value = entry.getValue();
|
||||
vo.setName(key);
|
||||
vo.setSpecification(value.getFirst().getSpecification());
|
||||
vo.setUnit(value.getFirst().getUnit());
|
||||
BigDecimal sum = value.stream().map(BusBillofquantities::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setQuantity(sum);
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归构建树形结构
|
||||
* @param parentId 父节点ID(顶级节点为0)
|
||||
*
|
||||
* @param parentId 父节点ID(顶级节点为0)
|
||||
* @param parentMap 父子映射表(key=pid,value=子节点列表)
|
||||
* @return 组装好的子树列表
|
||||
*/
|
||||
@ -310,7 +354,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
// 跳过空节点(无实际数据的中间节点)
|
||||
if (currentNode.getData().isEmpty()) {
|
||||
for (ExcelReader.TreeNode child : currentNode.getChildren()) {
|
||||
traverseTree(child, nodeMap, allMaterials, sheetName,banBen);
|
||||
traverseTree(child, nodeMap, allMaterials, sheetName, banBen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -333,8 +377,9 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
material.setPid(pid);
|
||||
material.setNum(aNum);
|
||||
material.setName(rowData.size() >= 2 ? rowData.get(1).trim() : null);
|
||||
material.setUnit(rowData.size() >= 3 ? rowData.get(2).trim() : null);
|
||||
String quantityStr = rowData.size() >= 4 ? rowData.get(3).trim() : null;
|
||||
material.setSpecification(rowData.size() >= 3 ? rowData.get(2).trim() : null);
|
||||
material.setUnit(rowData.size() >= 4 ? rowData.get(3).trim() : null);
|
||||
String quantityStr = rowData.size() >= 5 ? rowData.get(4).trim() : null;
|
||||
if (!quantityStr.isEmpty()) {
|
||||
try {
|
||||
// 支持整数和小数解析
|
||||
@ -343,7 +388,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
// 解析失败(如非数字内容),保持null
|
||||
}
|
||||
}
|
||||
material.setRemark(rowData.size() >= 5 ? rowData.get(4).trim() : null);
|
||||
material.setRemark(rowData.size() >= 6 ? rowData.get(5).trim() : null);
|
||||
|
||||
// 存储映射关系(供子节点查询父sid)
|
||||
nodeMap.put(currentNode, material);
|
||||
@ -351,7 +396,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
|
||||
// 递归处理子节点
|
||||
for (ExcelReader.TreeNode child : currentNode.getChildren()) {
|
||||
traverseTree(child, nodeMap, allMaterials, sheetName,banBen);
|
||||
traverseTree(child, nodeMap, allMaterials, sheetName, banBen);
|
||||
}
|
||||
}
|
||||
|
||||
@ -396,7 +441,6 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BusBillofquantitiesVersionsVo> obtainAllVersionNumbers(ObtainAllVersionNumbersReq bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBillofquantitiesVersions> lqw = Wrappers.lambdaQuery();
|
||||
@ -406,7 +450,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
lqw.orderByDesc(BusBillofquantitiesVersions::getCreateTime);
|
||||
Page<BusBillofquantitiesVersionsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(item -> {
|
||||
System.out.println("1 "+item.getStatus());
|
||||
System.out.println("1 " + item.getStatus());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
@ -438,11 +482,11 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('equipmentList')")
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('pickEquipmentList')")
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("物资设备清单审核任务执行了{}", processEvent.toString());
|
||||
log.info("招采清单审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
//变更状态
|
||||
//1、变更状态
|
||||
LambdaQueryWrapper<BusBillofquantitiesVersions> eq = new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||
.eq(BusBillofquantitiesVersions::getVersions, id);
|
||||
BusBillofquantitiesVersions busBillofquantitiesVersions = new BusBillofquantitiesVersions();
|
||||
@ -450,7 +494,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
boolean update = this.update(busBillofquantitiesVersions, eq);
|
||||
//变更成功,增加数据
|
||||
if (update && BusinessStatusEnum.FINISH.getStatus().equals(processEvent.getStatus())) {
|
||||
//2、根据版本号查询数据
|
||||
//根据版本号查询数据
|
||||
BusBillofquantitiesVersions versions = this.getOne(eq);
|
||||
//2、新增批次号
|
||||
String num = BatchNumberGenerator.generateBatchNumber("ZGY-");
|
||||
@ -458,7 +502,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
busTotalsupplyplanAudit.setProjectId(versions.getProjectId());
|
||||
busTotalsupplyplanAudit.setBatchNumber(num);
|
||||
boolean save = busTotalsupplyplanAuditService.save(busTotalsupplyplanAudit);
|
||||
if (!save){
|
||||
if (!save) {
|
||||
log.info("新增失败");
|
||||
}
|
||||
//1、根据查询数据
|
||||
@ -472,9 +516,10 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
busTotalsupplyplan.setId(null);
|
||||
}
|
||||
boolean b = busTotalsupplyplanService.saveBatch(busTotalsupplyplans);
|
||||
if (!b){
|
||||
if (!b) {
|
||||
log.info("新增失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -488,8 +533,54 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('equipmentList')")
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('pickEquipmentList')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("招采清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('pickEquipmentList')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("招采清单计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processPlansHandlErequipmentList(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());
|
||||
this.update(busBillofquantitiesVersions, eq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资设备清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
@ -501,8 +592,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('equipmentList')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("物资设备清单计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,11 +41,13 @@ import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
|
||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
|
||||
import org.dromara.design.domain.dto.designchange.DesDesignExtendDetailDto;
|
||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
import org.dromara.design.mapper.DesDesignChangeMapper;
|
||||
import org.dromara.design.service.IDesDesignChangeService;
|
||||
import org.dromara.design.service.IDesDrawingService;
|
||||
import org.dromara.design.service.IDesVolumeCatalogService;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
@ -276,6 +278,15 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
|
||||
if (projectId != null && projectService.getById(projectId) == null) {
|
||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
//编号不能重复
|
||||
List<DesDesignChange> list = list(Wrappers.lambdaQuery(DesDesignChange.class)
|
||||
.eq(DesDesignChange::getFormNo, entity.getFormNo())
|
||||
.eq(DesDesignChange::getProjectId, projectId)
|
||||
.ne(!create, DesDesignChange::getId, entity.getId())
|
||||
);
|
||||
if (!list.isEmpty()) {
|
||||
throw new ServiceException("编号已存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -423,7 +434,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
|
||||
String volumeName = req.getVolumeName();
|
||||
String volumeNo = req.getVolumeNo();
|
||||
String status = req.getStatus();
|
||||
lqw.orderByDesc(DesDesignChange::getId);
|
||||
lqw.orderByDesc(DesDesignChange::getCreateTime);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), DesDesignChange::getProjectId, projectId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(formNo), DesDesignChange::getFormNo, formNo);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(submitDate), DesDesignChange::getSubmitDate, submitDate);
|
||||
@ -604,12 +615,13 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
|
||||
|
||||
if("1".equals(bean.getDesignDisposal())){
|
||||
volumeFileService.lambdaUpdate()
|
||||
.set(DesVolumeFile::getStatus, "2")
|
||||
.set(DesVolumeFile::getType, DesVolumeFile.WASTE)
|
||||
.eq(DesVolumeFile::getType,DesVolumeFile.BLUEPRINT)
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, volumeCatalog.getDesign())
|
||||
.update();
|
||||
}else if("2".equals(bean.getDesignDisposal())){
|
||||
LambdaUpdateWrapper<DesVolumeFile> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.set(DesVolumeFile::getStatus, "2")
|
||||
wrapper.set(DesVolumeFile::getType, DesVolumeFile.WASTE)
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, volumeCatalog.getDesign());
|
||||
String saveFile = designChange.getSaveFile();
|
||||
if(StringUtils.isNotBlank(saveFile)){
|
||||
@ -629,24 +641,27 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
|
||||
.collect(Collectors.toList());
|
||||
List<SysOssVo> ossVoList1 = ossService.listByIds(fileIds);
|
||||
|
||||
//查询蓝图最大版本号
|
||||
List<DesVolumeFile> list = volumeFileService.list(Wrappers.lambdaQuery(DesVolumeFile.class)
|
||||
.eq(DesVolumeFile::getType, DesVolumeFile.BLUEPRINT)
|
||||
.orderByDesc(DesVolumeFile::getVersion)
|
||||
);
|
||||
String version = !list.isEmpty() ? String.valueOf(Integer.valueOf(list.getFirst().getVersion())+1) : "0";
|
||||
|
||||
for (SysOssVo ossVo : ossVoList1) {
|
||||
DesVolumeFile desVolumeFile = new DesVolumeFile();
|
||||
desVolumeFile.setVolumeCatalogId(volumeCatalog.getDesign());
|
||||
desVolumeFile.setFileName(ossVo.getOriginalName());
|
||||
desVolumeFile.setFileId(ossVo.getOssId());
|
||||
desVolumeFile.setStatus("1");
|
||||
desVolumeFile.setType("2");
|
||||
desVolumeFile.setStatus("2");
|
||||
desVolumeFile.setAuditStatus(BusinessStatusEnum.FINISH.getStatus());
|
||||
desVolumeFile.setType(DesVolumeFile.BLUEPRINT);
|
||||
desVolumeFile.setVersion(version);
|
||||
|
||||
volumeFileService.save(desVolumeFile);
|
||||
|
||||
DesDrawing desDrawing = new DesDrawing();
|
||||
desDrawing.setProjectId(volumeCatalog.getProjectId());
|
||||
desDrawing.setVolumeCatalogId(volumeCatalog.getDesign());
|
||||
desDrawing.setVolumeFileId(desVolumeFile.getId());
|
||||
drawingService.save(desDrawing);
|
||||
|
||||
//异步处理二维码
|
||||
self.addQRCodeToPDF(desVolumeFile.getId())
|
||||
self.addQRCodeToPDF(desVolumeFile.getId(),true)
|
||||
.thenAccept(result -> log.info("图纸[{}-{} ]添加二维码成功", desVolumeFile.getFileName(), desVolumeFile.getId()))
|
||||
.exceptionally(ex -> {
|
||||
log.error("图纸[{}-{}]添加二维码失败", desVolumeFile.getFileName(), desVolumeFile.getId(), ex);
|
||||
|
@ -40,6 +40,7 @@ import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@ -87,6 +88,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
|
||||
@Resource
|
||||
private IDesVolumeFileService volumeFilesService;
|
||||
|
||||
@Value("${qrCode.url}")
|
||||
private String qrCodeUrL;
|
||||
|
||||
/**
|
||||
* 查询图纸管理
|
||||
*
|
||||
@ -278,12 +282,15 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
|
||||
String fileStatus = req.getFileStatus();
|
||||
String originalName = req.getOriginalName();
|
||||
String newest = req.getNewest();
|
||||
Long volumeCatalogId = req.getVolumeCatalogId();
|
||||
lqw.like(StringUtils.isNotBlank(fileName), DesDrawing::getFileName, fileName);
|
||||
lqw.like(StringUtils.isNotBlank(originalName), DesDrawing::getOriginalName, originalName);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), DesDrawing::getProjectId, projectId);
|
||||
lqw.eq(StringUtils.isNotBlank(fileType), DesDrawing::getFileType, fileType);
|
||||
lqw.eq(StringUtils.isNotBlank(fileStatus), DesDrawing::getFileStatus, fileStatus);
|
||||
lqw.eq(StringUtils.isNotBlank(newest), DesDrawing::getNewest, newest);
|
||||
lqw.eq(StringUtils.isNotBlank(originalName), DesDrawing::getOriginalName, originalName);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(volumeCatalogId), DesDrawing::getVolumeCatalogId, volumeCatalogId);
|
||||
lqw.orderByDesc(DesDrawing::getNewest);
|
||||
lqw.orderByDesc(DesDrawing::getCreateTime);
|
||||
return lqw;
|
||||
@ -413,7 +420,7 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
|
||||
String params = "ID:[" + drawing.getId() + "] finish";
|
||||
byte[] bytes = PdfBoxQrCodeGenerator.generateQRCodeBytes(params);
|
||||
try {
|
||||
ByteArrayOutputStream baos = PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(ossVo.getUrl(), bytes,1510, 900);
|
||||
ByteArrayOutputStream baos = PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(ossVo.getUrl(), bytes,false);
|
||||
FileNameMap fileNameMap = URLConnection.getFileNameMap();
|
||||
String originalName = drawing.getOriginalName();
|
||||
String contentType = fileNameMap.getContentTypeFor(originalName);
|
||||
@ -428,7 +435,7 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> addQRCodeToPDF(Long volumeFileId) {
|
||||
public CompletableFuture<Boolean> addQRCodeToPDF(Long volumeFileId,boolean isChangeFile) {
|
||||
DesVolumeFile byId = volumeFilesService.getById(volumeFileId);
|
||||
Long fileUrl = byId.getFileId();
|
||||
if (fileUrl == null) {
|
||||
@ -436,10 +443,10 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
|
||||
}
|
||||
SysOssVo ossVo = ossService.getById(fileUrl);
|
||||
// 整合二维码需要显示的数据
|
||||
String params = "ID:[" + byId.getId() + "] finish";
|
||||
String params = qrCodeUrL+"/codeDetail?id="+volumeFileId;
|
||||
byte[] bytes = PdfBoxQrCodeGenerator.generateQRCodeBytes(params);
|
||||
try {
|
||||
ByteArrayOutputStream baos = PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(ossVo.getUrl(), bytes,1510, 900);
|
||||
ByteArrayOutputStream baos = PdfBoxQrCodeGenerator.addQRCodeToPDFOnAllPages(ossVo.getUrl(), bytes,isChangeFile);
|
||||
FileNameMap fileNameMap = URLConnection.getFileNameMap();
|
||||
String originalName = ossVo.getOriginalName();
|
||||
String contentType = fileNameMap.getContentTypeFor(originalName);
|
||||
|
@ -39,6 +39,7 @@ import org.dromara.design.service.IDesCollectFileService;
|
||||
import org.dromara.design.service.IDesExtractCatalogueService;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.http.MediaType;
|
||||
@ -82,6 +83,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
|
||||
|
||||
private final IDesVolumeFileService volumeFileService;
|
||||
|
||||
private final ISysOssService ossService;
|
||||
/**
|
||||
* 查询提资清单
|
||||
*
|
||||
@ -293,10 +295,17 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
|
||||
public List<DesCollectFileVo> fileList(Long id) {
|
||||
List<Long> catalogIds = extractCatalogueService.list(Wrappers.<DesExtractCatalogue>lambdaQuery()
|
||||
.eq(DesExtractCatalogue::getExtractId, id)).stream().map(DesExtractCatalogue::getVolumeCatalogId).toList();
|
||||
DesCollectFileBo desCollectFileBo = new DesCollectFileBo();
|
||||
desCollectFileBo.setCatalogueIds(catalogIds);
|
||||
if(catalogIds.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<DesVolumeFile> list = volumeFileService.list(Wrappers.<DesVolumeFile>lambdaQuery().in(DesVolumeFile::getVolumeCatalogId, catalogIds));
|
||||
return BeanUtil.copyToList(list, DesCollectFileVo.class);
|
||||
ArrayList<DesCollectFileVo> desCollectFileVos = new ArrayList<>();
|
||||
for (DesVolumeFile desVolumeFile : list){
|
||||
DesCollectFileVo desCollectFileVo = BeanUtil.copyProperties(desVolumeFile, DesCollectFileVo.class);
|
||||
desCollectFileVo.setFileUrl(ossService.getById(desVolumeFile.getFileId()).getUrl());
|
||||
desCollectFileVos.add(desCollectFileVo);
|
||||
}
|
||||
return desCollectFileVos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +74,8 @@ public class DesSubcontractServiceImpl extends ServiceImpl<DesSubcontractMapper,
|
||||
LambdaQueryWrapper<DesSubcontract> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(DesSubcontract::getId);
|
||||
lqw.eq(bo.getProjectId() != null, DesSubcontract::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSubContent()), DesSubcontract::getSubContent, bo.getSubContent());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSubContent()), DesSubcontract::getSubContent, bo.getSubContent());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRequirement()), DesSubcontract::getRequirement, bo.getRequirement());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -2,12 +2,14 @@ package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
@ -37,10 +39,7 @@ import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -83,12 +82,12 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
* @return 卷册目录
|
||||
*/
|
||||
@Override
|
||||
public DesVolumeCatalogVo queryById(Long id) {
|
||||
public DesVolumeCatalogVo queryById(Long id,String type) {
|
||||
DesVolumeCatalog volumeCatalog = this.getById(id);
|
||||
if (volumeCatalog == null) {
|
||||
throw new ServiceException("卷册目录信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(volumeCatalog);
|
||||
return this.getVo(volumeCatalog,type);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,7 +111,7 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
*/
|
||||
@Override
|
||||
public List<DesVolumeCatalogVo> queryList(DesVolumeCatalogQueryReq req) {
|
||||
return this.list(this.buildQueryWrapper(req)).stream().map(this::getVo).toList();
|
||||
return this.list(this.buildQueryWrapper(req)).stream().map(vo-> this.getVo(vo,req.getType())).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -122,9 +121,10 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
* @return 卷册目录文件列表
|
||||
*/
|
||||
@Override
|
||||
public List<DesVolumeFile> queryFileListById(Long id) {
|
||||
public List<DesVolumeFile> queryFileListById(Long id,String type) {
|
||||
return volumeFileService.lambdaQuery()
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, id)
|
||||
.eq(StringUtils.isNotBlank(type),DesVolumeFile::getType, type)
|
||||
.orderByAsc(DesVolumeFile::getStatus)
|
||||
.orderByDesc(DesVolumeFile::getCreateDept)
|
||||
.list();
|
||||
@ -230,14 +230,14 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
* @return 卷册目录封装对象
|
||||
*/
|
||||
@Override
|
||||
public DesVolumeCatalogVo getVo(DesVolumeCatalog volumeCatalog) {
|
||||
public DesVolumeCatalogVo getVo(DesVolumeCatalog volumeCatalog,String type) {
|
||||
DesVolumeCatalogVo vo = new DesVolumeCatalogVo();
|
||||
if (volumeCatalog == null) {
|
||||
return vo;
|
||||
}
|
||||
BeanUtils.copyProperties(volumeCatalog, vo);
|
||||
// 关联文件信息
|
||||
List<DesVolumeFile> volumeFiles = this.queryFileListById(volumeCatalog.getDesign());
|
||||
List<DesVolumeFile> volumeFiles = this.queryFileListById(volumeCatalog.getDesign(),type);
|
||||
vo.setFileVoList(volumeFileService.getVoList(volumeFiles));
|
||||
// 关联查阅人信息
|
||||
List<DesVolumeFileViewer> allViewerList = volumeFileViewerService.lambdaQuery()
|
||||
@ -276,6 +276,7 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
String volumeNumber = req.getVolumeNumber();
|
||||
String documentName = req.getDocumentName();
|
||||
String auditStatus = req.getAuditStatus();
|
||||
lqw.orderByDesc(DesVolumeCatalog::getCreateTime);
|
||||
lqw.like(StringUtils.isNotBlank(documentName), DesVolumeCatalog::getDocumentName, documentName);
|
||||
lqw.eq(StringUtils.isNotBlank(volumeNumber), DesVolumeCatalog::getVolumeNumber, volumeNumber);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), DesVolumeCatalog::getProjectId, projectId);
|
||||
@ -299,7 +300,7 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
if (CollUtil.isEmpty(volumeCatalogList)) {
|
||||
return volumeCatalogVoPage;
|
||||
}
|
||||
List<DesVolumeCatalogVo> volumeCatalogVoList = volumeCatalogList.stream().map(this::getVo).toList();
|
||||
List<DesVolumeCatalogVo> volumeCatalogVoList = volumeCatalogList.stream().map(vo-> getVo(vo,null)).toList();
|
||||
return volumeCatalogVoPage.setRecords(volumeCatalogVoList);
|
||||
}
|
||||
|
||||
@ -330,7 +331,27 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DesVolumeCatalog> catalogList(Long projectId) {
|
||||
|
||||
//查询已有审核通过蓝图的卷册目录
|
||||
List<DesVolumeFile> list = volumeFileService.list(Wrappers.lambdaQuery(DesVolumeFile.class)
|
||||
.eq(DesVolumeFile::getAuditStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
.eq(DesVolumeFile::getType, DesVolumeFile.BLUEPRINT)
|
||||
.orderByDesc(DesVolumeFile::getCreateTime)
|
||||
|
||||
);
|
||||
if(list.isEmpty()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> list1 = list.stream().map(DesVolumeFile::getVolumeCatalogId).distinct().toList();
|
||||
|
||||
return baseMapper.selectList(Wrappers.lambdaQuery(DesVolumeCatalog.class)
|
||||
.eq(DesVolumeCatalog::getProjectId, projectId)
|
||||
.in(DesVolumeCatalog::getDesign, list1)
|
||||
.orderByDesc(DesVolumeCatalog::getCreateTime)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
@ -367,7 +388,7 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
|
||||
desDrawings.add(desDrawing);
|
||||
//异步处理二维码
|
||||
self.addQRCodeToPDF(desVolumeFile.getId())
|
||||
self.addQRCodeToPDF(desVolumeFile.getId(),false)
|
||||
.thenAccept(result -> log.info("图纸[{}-{} ]添加二维码成功", desVolumeFile.getFileName(), desVolumeFile.getId()))
|
||||
.exceptionally(ex -> {
|
||||
log.error("图纸[{}-{}]添加二维码失败", desVolumeFile.getFileName(), desVolumeFile.getId(), ex);
|
||||
|
@ -1,34 +1,49 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.esotericsoftware.kryo.serializers.DefaultSerializers;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
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.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.design.domain.DesDrawing;
|
||||
import org.dromara.design.domain.DesVolumeCatalog;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.domain.DesVolumeFileViewer;
|
||||
import org.dromara.design.domain.bo.DesVolumeFileBo;
|
||||
import org.dromara.design.domain.dto.volumefile.DesVolumeFileCreateReq;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileCodeVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileJoinVo;
|
||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
|
||||
import org.dromara.design.mapper.DesVolumeFileMapper;
|
||||
import org.dromara.design.service.IDesDrawingService;
|
||||
import org.dromara.design.service.IDesVolumeCatalogService;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.dromara.design.service.IDesVolumeFileViewerService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 卷册文件Service业务层处理
|
||||
@ -37,8 +52,11 @@ import java.util.List;
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, DesVolumeFile>
|
||||
implements IDesVolumeFileService {
|
||||
@Resource
|
||||
private DesVolumeFileMapper baseMapper;
|
||||
|
||||
@Resource
|
||||
private ISysOssService ossService;
|
||||
@ -47,7 +65,89 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
|
||||
private IDesVolumeCatalogService volumeCatalogService;
|
||||
|
||||
@Resource
|
||||
private IDesVolumeFileViewerService volumeFileViewerService;
|
||||
private IBusProjectService projectService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IDesDrawingService self;
|
||||
/**
|
||||
* 分页查询卷册文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 卷册文件分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DesVolumeFileVo> queryPageList(DesVolumeFileBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DesVolumeFile> lqw = buildQueryWrapper(bo);
|
||||
Page<DesVolumeFileVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
for (DesVolumeFileVo vo : result.getRecords()) {
|
||||
SysOssVo ossVo = ossService.getById(vo.getFileId());
|
||||
vo.setFileUrl(ossVo.getUrl());
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
private LambdaQueryWrapper<DesVolumeFile> buildQueryWrapper(DesVolumeFileBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<DesVolumeFile> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(DesVolumeFile::getId);
|
||||
lqw.eq(bo.getVolumeCatalogId() != null, DesVolumeFile::getVolumeCatalogId, bo.getVolumeCatalogId());
|
||||
lqw.eq(bo.getFileId() != null, DesVolumeFile::getFileId, bo.getFileId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), DesVolumeFile::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), DesVolumeFile::getType, bo.getType());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<DesVolumeFileJoinVo> queryJoinPageList(DesVolumeFileBo bo, PageQuery pageQuery) {
|
||||
|
||||
Page<DesVolumeFileJoinVo> page = baseMapper.queryJoinPageList(pageQuery.build(), bo);
|
||||
for (DesVolumeFileJoinVo vo : page.getRecords()) {
|
||||
SysOssVo ossVo = ossService.getById(vo.getFileId());
|
||||
vo.setFileUrl(ossVo.getUrl());
|
||||
}
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DesVolumeFileCodeVo getCodeInfo(Long id) {
|
||||
DesVolumeFile desVolumeFile = getById(id);
|
||||
|
||||
|
||||
DesVolumeCatalog desVolumeCatalog = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId());
|
||||
DesVolumeFileCodeVo desVolumeFileCodeVo = BeanUtil.copyProperties(desVolumeCatalog, DesVolumeFileCodeVo.class);
|
||||
BusProject byId = projectService.getById(desVolumeCatalog.getProjectId());
|
||||
desVolumeFileCodeVo.setProjectName(byId.getProjectName());
|
||||
desVolumeFileCodeVo.setType(desVolumeFile.getType());
|
||||
|
||||
//查询过程图纸最新版
|
||||
List<DesVolumeFile> existingFiles = baseMapper.selectList(new LambdaQueryWrapper<DesVolumeFile>()
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, desVolumeFile.getVolumeCatalogId())
|
||||
.eq(DesVolumeFile::getType, "1")
|
||||
.orderByDesc(DesVolumeFile::getVersion));
|
||||
|
||||
DesVolumeFile first = existingFiles.getFirst();
|
||||
|
||||
if("4".equals(desVolumeFile.getType())){
|
||||
SysOssVo ossVo = ossService.getById(first.getFileId());
|
||||
desVolumeFileCodeVo.setFileUrl(ossVo.getUrl());
|
||||
}
|
||||
if("1".equals(desVolumeFile.getType()) ){
|
||||
|
||||
if(!first.getId().equals(id)){
|
||||
desVolumeFileCodeVo.setIsLatest(false);
|
||||
SysOssVo ossVo = ossService.getById(first.getFileId());
|
||||
desVolumeFileCodeVo.setFileUrl(ossVo.getUrl());
|
||||
}else{
|
||||
desVolumeFileCodeVo.setIsLatest(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return desVolumeFileCodeVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询卷册文件
|
||||
@ -79,77 +179,112 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
|
||||
if (volumeCatalog == null) {
|
||||
throw new ServiceException("对应卷册目录不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 判断是否需要废除其他文件
|
||||
// List<Long> cancellationIds = req.getCancellationIds();
|
||||
// if (CollUtil.isNotEmpty(cancellationIds)) {
|
||||
// List<DesVolumeFile> list = this.listByIds(cancellationIds);
|
||||
// list.forEach(item -> {
|
||||
// if (item.getStatus().equals("2")) {
|
||||
// return;
|
||||
// }
|
||||
// String name = item.getFileName();
|
||||
// String modified = name.replaceAll("((\\d{8}))", "($1-已作废)");
|
||||
// item.setFileName(modified);
|
||||
// item.setStatus("2");
|
||||
// });
|
||||
// if (CollUtil.isNotEmpty(list)) {
|
||||
// boolean update = this.updateBatchById(list);
|
||||
// if (!update) {
|
||||
// throw new ServiceException("更新卷册文件信息异常", HttpStatus.ERROR);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// 新增审阅人
|
||||
// List<Long> userIds = req.getUserIds();
|
||||
// if (CollUtil.isNotEmpty(userIds)) {
|
||||
// List<DesVolumeFileViewer> viewerList = userIds.stream().map(userId -> {
|
||||
// DesVolumeFileViewer viewer = new DesVolumeFileViewer();
|
||||
// viewer.setVolumeCatalogId(volumeCatalogId);
|
||||
// viewer.setUserId(userId);
|
||||
// return viewer;
|
||||
// }).toList();
|
||||
// // 删除以前的审阅人
|
||||
// Long count = volumeFileViewerService.lambdaQuery()
|
||||
// .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId)
|
||||
// .count();
|
||||
// if (count > 0) {
|
||||
// boolean remove = volumeFileViewerService.remove(new LambdaQueryWrapper<DesVolumeFileViewer>()
|
||||
// .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId));
|
||||
// if (!remove) {
|
||||
// throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
|
||||
// }
|
||||
// }
|
||||
// boolean result = volumeFileViewerService.saveBatch(viewerList);
|
||||
// if (!result) {
|
||||
// throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
|
||||
// }
|
||||
// }
|
||||
// 查看文件是否存在
|
||||
|
||||
if (CollectionUtil.isEmpty(req.getFileIds()) && CollectionUtil.isEmpty(req.getCancellationIds())) {
|
||||
throw new ServiceException("文件不能为空", HttpStatus.ERROR);
|
||||
}
|
||||
|
||||
//校验是否能上传
|
||||
validUpload(req);
|
||||
|
||||
ArrayList<DesVolumeFile> desVolumeFiles = new ArrayList<>();
|
||||
|
||||
// 蓝图文件
|
||||
if (CollectionUtil.isNotEmpty(req.getFileIds())) {
|
||||
processFiles(req, req.getFileIds(), "3", desVolumeFiles);
|
||||
}
|
||||
|
||||
ArrayList<DesVolumeFile> desVolumeFiles = new ArrayList<>();
|
||||
// 过程文件
|
||||
if (CollectionUtil.isNotEmpty(req.getCancellationIds())) {
|
||||
processFiles(req, req.getCancellationIds(), "1", desVolumeFiles);
|
||||
}
|
||||
|
||||
for (Long fileId : req.getFileIds()){
|
||||
SysOssVo ossVo = ossService.getById(fileId);
|
||||
if (ossVo == null) {
|
||||
throw new ServiceException("对应文件不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
DesVolumeFile file = new DesVolumeFile();
|
||||
BeanUtils.copyProperties(req, file);
|
||||
file.setFileId(fileId);
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
file.setFileName(ossVo.getOriginalName() + "(" + today + ")");
|
||||
desVolumeFiles.add(file);
|
||||
boolean save = saveBatch(desVolumeFiles);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增卷册文件信息异常", HttpStatus.ERROR);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void validUpload(DesVolumeFileCreateReq req){
|
||||
// 蓝图文件
|
||||
if (CollectionUtil.isNotEmpty(req.getFileIds())) {
|
||||
List<DesVolumeFile> existingFiles = baseMapper.selectList(new LambdaQueryWrapper<DesVolumeFile>()
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, req.getVolumeCatalogId())
|
||||
.eq(DesVolumeFile::getType, "3")
|
||||
.orderByDesc(DesVolumeFile::getVersion));
|
||||
if (!existingFiles.isEmpty()) {
|
||||
throw new ServiceException("蓝图已上传");
|
||||
}
|
||||
boolean save = saveBatch(desVolumeFiles);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增卷册文件信息异常", HttpStatus.ERROR);
|
||||
}
|
||||
// 过程文件
|
||||
if (CollectionUtil.isNotEmpty(req.getCancellationIds())) {
|
||||
List<DesVolumeFile> existingFiles = baseMapper.selectList(new LambdaQueryWrapper<DesVolumeFile>()
|
||||
.eq(DesVolumeFile::getVolumeCatalogId, req.getVolumeCatalogId())
|
||||
.eq(DesVolumeFile::getType, "1")
|
||||
.orderByDesc(DesVolumeFile::getVersion));
|
||||
if (!existingFiles.isEmpty()) {
|
||||
DesVolumeFile first = existingFiles.getFirst();
|
||||
if(!BusinessStatusEnum.FINISH.getStatus().equals(first.getAuditStatus())){
|
||||
throw new ServiceException("文件尚未审核完成,请勿重复上传");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理文件上传
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @param fileIds 文件ID列表
|
||||
* @param type 文件类型
|
||||
* @param desVolumeFiles 文件集合
|
||||
*/
|
||||
private void processFiles(DesVolumeFileCreateReq req, List<Long> fileIds, String type, List<DesVolumeFile> desVolumeFiles) {
|
||||
// 用于记录同一批次中已处理的文件名及对应的版本号
|
||||
Map<String, Integer> batchFileVersionMap = new HashMap<>();
|
||||
|
||||
for (Long fileId : fileIds) {
|
||||
SysOssVo ossVo = ossService.getById(fileId);
|
||||
if (ossVo == null) {
|
||||
throw new ServiceException("对应文件不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
DesVolumeFile file = new DesVolumeFile();
|
||||
BeanUtils.copyProperties(req, file);
|
||||
file.setFileId(fileId);
|
||||
|
||||
String fileName = ossVo.getOriginalName();
|
||||
|
||||
// 根据文件类型和文件名判断是否存在文件,存在则版本号往上增
|
||||
List<DesVolumeFile> existingFiles = baseMapper.selectList(new LambdaQueryWrapper<DesVolumeFile>()
|
||||
.eq(DesVolumeFile::getType, type)
|
||||
.eq(DesVolumeFile::getFileName, fileName)
|
||||
.orderByDesc(DesVolumeFile::getVersion));
|
||||
|
||||
int version = 0;
|
||||
if (CollectionUtil.isNotEmpty(existingFiles)) {
|
||||
version = Integer.parseInt(existingFiles.getFirst().getVersion()) + 1;
|
||||
}
|
||||
|
||||
// 检查同一批次中是否已存在同名文件
|
||||
if (batchFileVersionMap.containsKey(fileName)) {
|
||||
// 如果存在,则在原有版本号基础上+1
|
||||
version = Math.max(version, batchFileVersionMap.get(fileName) + 1);
|
||||
}
|
||||
|
||||
// 更新批次文件版本映射
|
||||
batchFileVersionMap.put(fileName, version);
|
||||
|
||||
file.setVersion(String.valueOf(version));
|
||||
file.setFileName(fileName);
|
||||
desVolumeFiles.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除卷册文件信息
|
||||
*
|
||||
@ -214,4 +349,136 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
|
||||
return volumeFileVoPage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('procDesignFile')")
|
||||
@Transactional
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("过程图纸评审审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
DesVolumeFile desVolumeFile = this.getById(Long.valueOf(id));
|
||||
if (desVolumeFile == null) {
|
||||
return;
|
||||
}
|
||||
desVolumeFile.setAuditStatus(processEvent.getStatus());
|
||||
//如果完成,以前的图纸类型变为作废图纸,状态改为作废 暂定
|
||||
if (processEvent.getStatus().equals("finish")){
|
||||
// this.lambdaUpdate().set(DesVolumeFile::getStatus, "2")
|
||||
// .set(DesVolumeFile::getType, "4")
|
||||
// .eq(DesVolumeFile::getVolumeCatalogId, desVolumeFile.getVolumeCatalogId())
|
||||
// .eq(DesVolumeFile::getType, "1")
|
||||
// .ne(DesVolumeFile::getId, desVolumeFile.getId())
|
||||
// .update();
|
||||
//异步处理二维码
|
||||
self.addQRCodeToPDF(desVolumeFile.getId(),false)
|
||||
.thenAccept(result -> log.info("图纸[{}-{} ]添加二维码成功", desVolumeFile.getFileName(), desVolumeFile.getId()))
|
||||
.exceptionally(ex -> {
|
||||
log.error("图纸[{}-{}]添加二维码失败", desVolumeFile.getFileName(), desVolumeFile.getId(), ex);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
this.updateById(desVolumeFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('procDesignFile')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("过程图纸评审审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('procDesignFile')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("过程图纸评审计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('bpDesignFile')")
|
||||
@Transactional
|
||||
public void bpProcessPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("蓝图评审审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
DesVolumeFile desVolumeFile = this.getById(Long.valueOf(id));
|
||||
if (desVolumeFile == null) {
|
||||
return;
|
||||
}
|
||||
desVolumeFile.setAuditStatus(processEvent.getStatus());
|
||||
if (processEvent.getStatus().equals("finish")){
|
||||
//异步处理二维码
|
||||
self.addQRCodeToPDF(desVolumeFile.getId(),false)
|
||||
.thenAccept(result -> log.info("图纸[{}-{} ]添加二维码成功", desVolumeFile.getFileName(), desVolumeFile.getId()))
|
||||
.exceptionally(ex -> {
|
||||
log.error("图纸[{}-{}]添加二维码失败", desVolumeFile.getFileName(), desVolumeFile.getId(), ex);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
this.updateById(desVolumeFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('bpDesignFile')")
|
||||
public void bpProcessTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("蓝图评审审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('bpDesignFile')")
|
||||
public void bpProcessDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("蓝图评审计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -17,10 +17,7 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.project.domain.dto.project.BusProjectCreateReq;
|
||||
import org.dromara.project.domain.dto.project.BusProjectCreateSubReq;
|
||||
import org.dromara.project.domain.dto.project.BusProjectQueryReq;
|
||||
import org.dromara.project.domain.dto.project.BusProjectUpdateReq;
|
||||
import org.dromara.project.domain.dto.project.*;
|
||||
import org.dromara.project.domain.vo.project.*;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -151,6 +148,17 @@ public class BusProjectController extends BaseController {
|
||||
return toAjax(projectService.updateByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存项目招标文件
|
||||
*/
|
||||
@SaCheckPermission("project:project:saveTenderFile")
|
||||
@Log(title = "项目", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/save/tender/file")
|
||||
public R<Void> uploadTenderFile(@RequestBody BusProjectSaveTenderFileReq req) {
|
||||
return toAjax(projectService.saveTenderFile(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
*
|
||||
|
@ -81,9 +81,9 @@ public class BusProject extends BaseEntity {
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
* 项目阶段
|
||||
*/
|
||||
private String projectCategory;
|
||||
private String projectStage;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
@ -135,6 +135,11 @@ public class BusProject extends BaseEntity {
|
||||
*/
|
||||
private String securityAgreement;
|
||||
|
||||
/**
|
||||
* 招标文件
|
||||
*/
|
||||
private String tenderFiles;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
|
@ -51,9 +51,9 @@ public class BusProjectCreateReq implements Serializable {
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
* 项目阶段
|
||||
*/
|
||||
private String projectCategory;
|
||||
private String projectStage;
|
||||
|
||||
/**
|
||||
* 项目地址
|
||||
@ -105,6 +105,11 @@ public class BusProjectCreateReq implements Serializable {
|
||||
*/
|
||||
private String securityAgreement;
|
||||
|
||||
/**
|
||||
* 招标文件
|
||||
*/
|
||||
private String tenderFiles;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
|
@ -40,30 +40,15 @@ public class BusProjectQueryReq implements Serializable {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
* 项目阶段
|
||||
*/
|
||||
private String projectCategory;
|
||||
private String projectStage;
|
||||
|
||||
/**
|
||||
* 项目地址
|
||||
@ -80,31 +65,6 @@ public class BusProjectQueryReq implements Serializable {
|
||||
*/
|
||||
private String principalPhone;
|
||||
|
||||
/**
|
||||
* 实际容量
|
||||
*/
|
||||
private String actual;
|
||||
|
||||
/**
|
||||
* 计划容量
|
||||
*/
|
||||
private String plan;
|
||||
|
||||
/**
|
||||
* 开工时间
|
||||
*/
|
||||
private String onStreamTime;
|
||||
|
||||
/**
|
||||
* 打卡范围(09:00,18:00)
|
||||
*/
|
||||
private String punchRange;
|
||||
|
||||
/**
|
||||
* 设计总量
|
||||
*/
|
||||
private Long designTotal;
|
||||
|
||||
/**
|
||||
* 显示隐藏(0显示 1隐藏)
|
||||
*/
|
||||
|
@ -0,0 +1,31 @@
|
||||
package org.dromara.project.domain.dto.project;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-19 17:34
|
||||
*/
|
||||
@Data
|
||||
public class BusProjectSaveTenderFileReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8690332210810915922L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 招标文件
|
||||
*/
|
||||
@NotBlank(message = "招标文件不能为空")
|
||||
private String tenderFiles;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user