73 changed files with 2610 additions and 551 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,273 @@ |
|||
package org.dromara.productManagement.common.service; |
|||
|
|||
import cn.dev33.satoken.stp.StpUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.common.core.service.DictService; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.ModelPrompts; |
|||
import org.dromara.productManagement.domain.ModelUserPromptssetting; |
|||
|
|||
import org.dromara.productManagement.domain.bo.BaseTaskBo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksPermissionsVo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.enums.TaskEnum; |
|||
import org.dromara.productManagement.mapper.DocumentTasksMapper; |
|||
import org.dromara.productManagement.mapper.DocumentTasksPermissionsMapper; |
|||
import org.dromara.productManagement.mapper.ModelPromptsMapper; |
|||
import org.dromara.productManagement.mapper.ModelUserPromptssettingMapper; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsService; |
|||
import org.dromara.productManagement.service.IDocumentTasksService; |
|||
import org.dromara.productManagement.utils.MyHttpUtils; |
|||
import org.dromara.system.domain.vo.SysOssVo; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.dromara.system.service.ISysUserService; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 任务处理抽象基类 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Data |
|||
public abstract class BaseTaskService<T extends BaseTaskBo> { |
|||
|
|||
|
|||
protected final ISysOssService ossService; |
|||
protected final ISysUserService userService; |
|||
protected final ModelPromptsMapper modelPromptsMapper; |
|||
|
|||
protected final ModelUserPromptssettingMapper modelUserPromptssettingMapper; |
|||
protected final DocumentTasksPermissionsMapper documentTasksPermissionsMapper; |
|||
protected final IDocumentTasksPermissionsService documentTasksPermissionsService; |
|||
protected final DictService dictTypeService; |
|||
protected final DocumentTasksMapper baseMapper; |
|||
|
|||
|
|||
@Value("${chat.filePath}") |
|||
protected String fileRootPath; |
|||
|
|||
@Value("${chat.chatUrl}") |
|||
protected String chatUrl; |
|||
@Value("${chat.tempfilePath}") |
|||
protected String tempfilePath; |
|||
/** |
|||
* 文件处理结果内部类 |
|||
*/ |
|||
@Data |
|||
@AllArgsConstructor |
|||
protected static class FileProcessResult { |
|||
private String fileName; |
|||
private String filePath; |
|||
} |
|||
/** |
|||
* 查询任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 合同任务 |
|||
*/ |
|||
protected DocumentTasksVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
/** |
|||
* 处理任务的抽象方法 |
|||
*/ |
|||
protected Boolean handleTask(T bo, String taskType) throws IOException, InterruptedException { |
|||
List<String> taskNames = bo.getTaskNameList(); |
|||
Long userId = LoginHelper.getUserId(); |
|||
|
|||
// 校验提示词
|
|||
validatePrompts(taskNames, bo, taskType); |
|||
|
|||
// 处理用户提示词设置
|
|||
handleUserPromptsSetting(userId, bo, taskType); |
|||
|
|||
// 验证用户任务权限
|
|||
documentTasksPermissionsService.validateUserTaskPermissions(taskType,taskNames, userId); |
|||
|
|||
// 处理文件相关操作
|
|||
FileProcessResult fileResult = processFile(bo.getOssId()); |
|||
|
|||
return processTaskItems(taskNames, bo, fileResult, taskType); |
|||
} |
|||
|
|||
/** |
|||
* 校验提示词 |
|||
*/ |
|||
private void validatePrompts(List<String> taskNames, T bo, String taskType) { |
|||
taskNames.forEach(taskName -> { |
|||
ModelPrompts modelPrompts = modelPromptsMapper.selectOne(Wrappers.<ModelPrompts>lambdaQuery() |
|||
.eq(ModelPrompts::getTaskType, taskType) |
|||
.eq(ModelPrompts::getTaskName, taskName) |
|||
.eq(ModelPrompts::getTaskIndustry, bo.getTaskIndustry()) |
|||
.eq(ModelPrompts::getTaskRegion, bo.getTaskRegion())); |
|||
if(modelPrompts == null) { |
|||
String label = dictTypeService.getDictLabel(taskType, taskName); |
|||
throw new RuntimeException("任务名称:["+label+"],当前任务所属区域或所属行业不存在模型,请联系管理员配置"); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 处理用户提示词设置 |
|||
*/ |
|||
private void handleUserPromptsSetting(Long userId, T bo, String taskType) { |
|||
ModelUserPromptssetting promptssetting = modelUserPromptssettingMapper.selectOne( |
|||
Wrappers.<ModelUserPromptssetting>lambdaQuery() |
|||
.eq(ModelUserPromptssetting::getUserId, userId) |
|||
.eq(ModelUserPromptssetting::getTaskType, taskType)); |
|||
|
|||
if(promptssetting != null) { |
|||
promptssetting.setTaskIndustry(bo.getTaskIndustry()); |
|||
promptssetting.setTaskRegion(bo.getTaskRegion()); |
|||
promptssetting.setTaskType(taskType); |
|||
modelUserPromptssettingMapper.updateById(promptssetting); |
|||
} else { |
|||
ModelUserPromptssetting userPromptssetting = new ModelUserPromptssetting(); |
|||
userPromptssetting.setUserId(userId); |
|||
userPromptssetting.setTaskIndustry(bo.getTaskIndustry()); |
|||
userPromptssetting.setTaskRegion(bo.getTaskRegion()); |
|||
userPromptssetting.setTaskType(taskType); |
|||
modelUserPromptssettingMapper.insert(userPromptssetting); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 处理文件操作 |
|||
*/ |
|||
protected FileProcessResult processFile(Long ossId) throws IOException, InterruptedException { |
|||
SysOssVo fileInfo = ossService.getById(ossId); |
|||
String fileName = fileInfo.getOriginalName(); |
|||
String filePath = fileRootPath + fileInfo.getFileName(); |
|||
|
|||
// 处理文件转换
|
|||
if(!fileName.toLowerCase().endsWith(".docx")) { |
|||
filePath = convertToDocx(filePath, fileName); |
|||
} |
|||
|
|||
return new FileProcessResult(fileInfo.getOriginalName(), filePath); |
|||
} |
|||
|
|||
/** |
|||
* 转换文件为docx格式 |
|||
*/ |
|||
private String convertToDocx(String filePath, String fileName) throws IOException, InterruptedException { |
|||
String parentPath = new File(filePath).getParent(); |
|||
ProcessBuilder builder = new ProcessBuilder("libreoffice", "--headless", "--convert-to", "docx", filePath, "--outdir", parentPath); |
|||
Process process = builder.start(); |
|||
|
|||
int completed = process.waitFor(); |
|||
if (completed != 0) { |
|||
InputStream errorStream = process.getErrorStream(); |
|||
String errorMessage = new String(errorStream.readAllBytes()); |
|||
process.destroyForcibly(); |
|||
throw new RuntimeException(fileName + "转docx失败,请检查文件是否正确~ 错误信息: " + errorMessage); |
|||
} |
|||
|
|||
process.destroyForcibly(); |
|||
return getDocxFilePath(filePath); |
|||
} |
|||
|
|||
/** |
|||
* 获取转换后的docx文件路径 |
|||
*/ |
|||
private String getDocxFilePath(String filePath) { |
|||
int lastDotIndex = filePath.lastIndexOf('.'); |
|||
return lastDotIndex == -1 ? filePath + ".docx" : filePath.substring(0, lastDotIndex) + ".docx"; |
|||
} |
|||
/** |
|||
* 计算任务优先级 |
|||
* @param taskName 任务名称 |
|||
* @return 优先级 |
|||
*/ |
|||
protected Long calculatePriority(String taskName) { |
|||
// 默认优先级为1
|
|||
Long priority = 1L; |
|||
|
|||
// 如果不是超级管理员,则获取用户特定的任务优先级
|
|||
if (!StpUtil.hasRole("superadmin")) { |
|||
DocumentTasksPermissionsVo permissionsVo = documentTasksPermissionsMapper |
|||
.selectDocumentPermissionsByUserIdAndTaskName( |
|||
LoginHelper.getUserId(), |
|||
taskName |
|||
); |
|||
if (permissionsVo != null) { |
|||
priority = permissionsVo.getPriority(); |
|||
} |
|||
} |
|||
|
|||
return priority; |
|||
} |
|||
|
|||
/** |
|||
* 处理具体任务项 |
|||
*/ |
|||
// protected abstract Boolean processTaskItems(List<String> taskNames, BaseTaskBo bo, FileProcessResult fileResult, String taskType);
|
|||
protected Boolean processTaskItems(List<String> taskNames, T bo, FileProcessResult fileResult, String taskType) { |
|||
boolean flag = false; |
|||
for (String taskName : taskNames) { |
|||
|
|||
DocumentTasks add = MapstructUtils.convert(bo, DocumentTasks.class); |
|||
add.setTaskName(taskName); |
|||
add.setDocumentName(fileResult.getFileName()); |
|||
add.setProgressStatus("PENDING"); |
|||
add.setTaskType(taskType); |
|||
// 在插入数据库前调用扩展点
|
|||
beforeTaskInsert(bo, taskName, fileResult); |
|||
|
|||
flag = baseMapper.insert(add) > 0; |
|||
// 在发送消息前调用扩展点
|
|||
beforeTaskMessageSent(add.getId(), taskName, bo); |
|||
Long priority = calculatePriority(taskName); |
|||
MyHttpUtils.sendTaskStartMessage(chatUrl + "/back/taskStart", |
|||
add.getId(), taskName, fileResult.getFilePath(), priority); |
|||
|
|||
if (!flag) { |
|||
throw new RuntimeException("新增文档任务失败"); |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
|
|||
|
|||
protected LambdaQueryWrapper<DocumentTasks> buildQueryWrapper(DocumentTasksBo bo) { |
|||
LambdaQueryWrapper<DocumentTasks> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskIndustry()), DocumentTasks::getTaskIndustry, bo.getTaskIndustry()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskRegion()), DocumentTasks::getTaskRegion, bo.getTaskRegion()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), DocumentTasks::getDocumentName, bo.getDocumentName()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getProgressStatus()), DocumentTasks::getProgressStatus, bo.getProgressStatus()); |
|||
List<String> taskNames = bo.getTaskNameList(); |
|||
if (taskNames != null && !taskNames.isEmpty()) { |
|||
lqw.in(DocumentTasks::getTaskName, taskNames); |
|||
} |
|||
lqw.orderByDesc(DocumentTasks::getCreateTime); |
|||
return lqw; |
|||
} |
|||
/** |
|||
* 任务插入数据库前的扩展点 |
|||
* 子类可以覆盖此方法添加额外逻辑 |
|||
*/ |
|||
protected void beforeTaskInsert(T task, String taskName, FileProcessResult fileResult) { |
|||
// 默认空实现
|
|||
} |
|||
|
|||
/** |
|||
* 任务消息发送前的扩展点 |
|||
* 子类可以覆盖此方法添加额外逻辑 |
|||
*/ |
|||
protected void beforeTaskMessageSent(Long taskId, String taskName,T bo) { |
|||
// 默认空实现
|
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.vo.DocumentTasksVo; |
|||
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.productManagement.domain.vo.SchemEvaluationVo; |
|||
import org.dromara.productManagement.domain.bo.SchemEvaluationBo; |
|||
import org.dromara.productManagement.service.ISchemEvaluationService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 方案评价任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/SchemEvaluation") |
|||
public class SchemEvaluationController extends BaseController { |
|||
|
|||
private final ISchemEvaluationService schemEvaluationService; |
|||
|
|||
/** |
|||
* 查询方案评价任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksVo> list(SchemEvaluationBo bo, PageQuery pageQuery) { |
|||
return schemEvaluationService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出方案评价任务列表 |
|||
*/ |
|||
// @SaCheckPermission("productManagement:SchemEvaluation:export")
|
|||
// @Log(title = "方案评价任务", businessType = BusinessType.EXPORT)
|
|||
// @PostMapping("/export")
|
|||
// public void export(SchemEvaluationBo bo, HttpServletResponse response) {
|
|||
// List<DocumentTasksVo> list = schemEvaluationService.queryList(bo);
|
|||
// ExcelUtil.exportExcel(list, "方案评价任务", SchemEvaluationVo.class, response);
|
|||
// }
|
|||
|
|||
/** |
|||
* 获取方案评价任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(schemEvaluationService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增方案评价任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:add") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchemEvaluationBo bo) throws IOException, InterruptedException { |
|||
return toAjax(schemEvaluationService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改方案评价任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:edit") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchemEvaluationBo bo) { |
|||
return toAjax(schemEvaluationService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除方案评价任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:SchemEvaluation:remove") |
|||
@Log(title = "方案评价任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(schemEvaluationService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package org.dromara.productManagement.controller; |
|||
|
|||
import java.io.IOException; |
|||
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.productManagement.domain.vo.DocumentTasksVo; |
|||
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.productManagement.domain.vo.TenderTaskVo; |
|||
import org.dromara.productManagement.domain.bo.TenderTaskBo; |
|||
import org.dromara.productManagement.service.ITenderTaskService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 招标审核任务 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/productManagement/TenderTask") |
|||
public class TenderTaskController extends BaseController { |
|||
|
|||
private final ITenderTaskService tenderTaskService; |
|||
|
|||
/** |
|||
* 查询招标审核任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTasksVo> list(TenderTaskBo bo, PageQuery pageQuery) { |
|||
return tenderTaskService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出招标审核任务列表 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:export") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(TenderTaskBo bo, HttpServletResponse response) { |
|||
// List<DocumentTasksVo> list = tenderTaskService.queryList(bo);
|
|||
// ExcelUtil.exportExcel(list, "招标审核任务", TenderTaskVo.class, response);
|
|||
} |
|||
|
|||
/** |
|||
* 获取招标审核任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTasksVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(tenderTaskService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增招标审核任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:add") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TenderTaskBo bo) throws IOException, InterruptedException { |
|||
return toAjax(tenderTaskService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改招标审核任务 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:edit") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TenderTaskBo bo) { |
|||
return toAjax(tenderTaskService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除招标审核任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("productManagement:TenderTask:remove") |
|||
@Log(title = "招标审核任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(tenderTaskService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
对象 contractual_task_supplement |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("contractual_task_supplement") |
|||
public class ContractualTaskSupplement extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务id |
|||
*/ |
|||
private Long documentTasksId; |
|||
|
|||
/** |
|||
* 合同角色 |
|||
*/ |
|||
private String contractPartyRole; |
|||
|
|||
|
|||
} |
@ -0,0 +1,92 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
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; |
|||
|
|||
/** |
|||
* 方案评价任务对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("tender_summary_task") |
|||
public class SchemEvaluation extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
|
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
|
|||
/** |
|||
* 文档名称 |
|||
*/ |
|||
private String documentName; |
|||
|
|||
/** |
|||
* ossid |
|||
*/ |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* 预计完成时间 |
|||
*/ |
|||
private Date estimatedCompletionTime; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
private String progressStatus; |
|||
|
|||
/** |
|||
* 删除标志 0 有效 2删除 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本 |
|||
|
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
|
|||
/** |
|||
* python任务id |
|||
*/ |
|||
private String taskId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,93 @@ |
|||
package org.dromara.productManagement.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.util.Date; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 招标摘要任务对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("tender_summary_task") |
|||
public class TenderTask extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
|
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
|
|||
/** |
|||
* 文档名称 |
|||
*/ |
|||
private String documentName; |
|||
|
|||
/** |
|||
* ossid |
|||
*/ |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* 预计完成时间 |
|||
*/ |
|||
private Date estimatedCompletionTime; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
|
|||
*/ |
|||
private String progressStatus; |
|||
|
|||
/** |
|||
* 删除标志 0 有效 2删除 |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 版本 |
|||
|
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
|
|||
|
|||
/** |
|||
* python任务id |
|||
*/ |
|||
private String taskId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package org.dromara.productManagement.domain.bo; |
|||
|
|||
import jakarta.validation.constraints.NotBlank; |
|||
import jakarta.validation.constraints.NotEmpty; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.Data; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
|
|||
import java.util.List; |
|||
@Data |
|||
public class BaseTaskBo extends BaseEntity { |
|||
|
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
@NotBlank(message = "模型所属行业不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
@NotBlank(message = "模型所属区域不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskRegion; |
|||
|
|||
|
|||
@NotEmpty(message = "任务名称列表不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private List<@NotBlank(message = "任务名称不能为空") String> taskNameList; |
|||
/** |
|||
* |
|||
*/ |
|||
private String documentName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String progressStatus; |
|||
|
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskType; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
private String taskName; |
|||
} |
@ -0,0 +1,42 @@ |
|||
package org.dromara.productManagement.domain.bo; |
|||
|
|||
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 org.dromara.productManagement.domain.ContractualTaskSupplement; |
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
业务对象 contractual_task_supplement |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ContractualTaskSupplement.class, reverseConvertGenerate = false) |
|||
public class ContractualTaskSupplementBo extends BaseEntity { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务id |
|||
*/ |
|||
@NotNull(message = "任务id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long documentTasksId; |
|||
|
|||
/** |
|||
* 合同角色 |
|||
*/ |
|||
@NotBlank(message = "合同角色不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String contractPartyRole; |
|||
|
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package org.dromara.productManagement.domain.bo; |
|||
|
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.SchemEvaluation; |
|||
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; |
|||
|
|||
/** |
|||
* 方案评价任务业务对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = DocumentTasks.class, reverseConvertGenerate = false) |
|||
public class SchemEvaluationBo extends BaseTaskBo { |
|||
private Long id; |
|||
|
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package org.dromara.productManagement.domain.bo; |
|||
|
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.TenderTask; |
|||
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.*; |
|||
|
|||
/** |
|||
* 招标摘要任务业务对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = DocumentTasks.class, reverseConvertGenerate = false) |
|||
public class TenderTaskBo extends BaseTaskBo { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
|
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
package org.dromara.productManagement.domain.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class BaseTaskVo { |
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
@ExcelProperty(value = "任务名称", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "scheme_review") |
|||
private String taskName; |
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
@ExcelProperty(value = "任务类型", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "task_type") |
|||
private String taskType; |
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
@ExcelProperty(value = "模型所属区域", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "model_region") |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
@ExcelProperty(value = "模型所属行业", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "model_industry") |
|||
private String taskIndustry; |
|||
/** |
|||
* 文档名称 |
|||
*/ |
|||
@ExcelProperty(value = "文档名称") |
|||
private String documentName; |
|||
/** |
|||
* 后台任务id |
|||
*/ |
|||
private String taskId; |
|||
/** |
|||
* 预计时间 |
|||
*/ |
|||
@ExcelProperty(value = "预计时间") |
|||
private Date estimatedCompletionTime; |
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "document_task_status") |
|||
private String progressStatus; |
|||
/** |
|||
* 任务时长 |
|||
*/ |
|||
private String taskDuration; |
|||
@ExcelProperty(value = "上传时间") |
|||
private Date createTime; |
|||
|
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long createBy; |
|||
private String createUser; |
|||
|
|||
@ExcelProperty(value = "更新时间") |
|||
private Date updateTime; |
|||
} |
@ -0,0 +1,50 @@ |
|||
package org.dromara.productManagement.domain.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
|
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import org.dromara.productManagement.domain.ContractualTaskSupplement; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
视图对象 contractual_task_supplement |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ContractualTaskSupplement.class) |
|||
public class ContractualTaskSupplementVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@ExcelProperty(value = "") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 任务id |
|||
*/ |
|||
@ExcelProperty(value = "任务id") |
|||
private Long documentTasksId; |
|||
|
|||
/** |
|||
* 合同角色 |
|||
*/ |
|||
@ExcelProperty(value = "合同角色") |
|||
private String contractPartyRole; |
|||
|
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package org.dromara.productManagement.domain.vo; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.productManagement.domain.SchemEvaluation; |
|||
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; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 方案评价任务视图对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = SchemEvaluation.class) |
|||
public class SchemEvaluationVo extends BaseTaskVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
|
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package org.dromara.productManagement.domain.vo; |
|||
|
|||
import org.dromara.productManagement.domain.TenderTask; |
|||
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; |
|||
|
|||
|
|||
/** |
|||
* 招标摘要任务视图对象 tender_summary_task |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = TenderTask.class) |
|||
public class TenderTaskVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 模型所属行业 |
|||
*/ |
|||
@ExcelProperty(value = "模型所属行业", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "model_industry") |
|||
private String taskIndustry; |
|||
|
|||
/** |
|||
* 模型所属区域 |
|||
*/ |
|||
@ExcelProperty(value = "模型所属区域", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "model_region") |
|||
private String taskRegion; |
|||
|
|||
/** |
|||
* 任务名称 |
|||
*/ |
|||
@ExcelProperty(value = "任务名称") |
|||
private String taskName; |
|||
|
|||
/** |
|||
* 文档名称 |
|||
*/ |
|||
@ExcelProperty(value = "文档名称") |
|||
private String documentName; |
|||
|
|||
/** |
|||
* ossid |
|||
*/ |
|||
@ExcelProperty(value = "ossid") |
|||
private Long ossId; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
|
|||
*/ |
|||
@ExcelProperty(value = "当前状态 ", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "document_task_status") |
|||
private String progressStatus; |
|||
|
|||
|
|||
} |
@ -0,0 +1,96 @@ |
|||
package org.dromara.productManagement.enums; |
|||
|
|||
public class TaskEnum { |
|||
public enum TaskType { |
|||
SCHEME_REVIEW("scheme_review", "方案审核"), |
|||
CONTRACT_REVIEW("contract_review", "合同审核"), |
|||
TENDER_REVIEW("tender_review", "招标审核"), |
|||
|
|||
SCHEME_EVALUATION("scheme_evaluation", "方案评价"), |
|||
PROJECT_DOCUMENT_REVIEW("project_document_review", "项目文档审核"); |
|||
|
|||
private final String value; |
|||
private final String label; |
|||
|
|||
TaskType(String value, String label) { |
|||
this.value = value; |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
} |
|||
|
|||
// 方案审核子任务枚举
|
|||
public enum SchemeTask { |
|||
DOCUMENT_SIMILARITY("checkRepeatText", "文档相似性检查"), |
|||
DOCUMENT_ERROR("checkDocumentError", "文档纠错"), |
|||
SCHEME_EVALUATION("schemEvaluation", "方案评价"), |
|||
PLACE_CHECK("checkPlaceName", "地名检查"), |
|||
COMPANY_CHECK("checkCompanyName", "公司名称检查"), |
|||
TITLE_CHECK("checkTitleName", "文档结构检查"); |
|||
|
|||
private final String value; |
|||
private final String label; |
|||
|
|||
SchemeTask(String value, String label) { |
|||
this.value = value; |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
} |
|||
|
|||
// 合同审核子任务枚举
|
|||
public enum ContractTask { |
|||
CONTRACT_REVIEW("contractReview", "合同审核"); |
|||
|
|||
private final String value; |
|||
private final String label; |
|||
|
|||
ContractTask(String value, String label) { |
|||
this.value = value; |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
} |
|||
|
|||
// 招标审核子任务枚举
|
|||
public enum TenderTask { |
|||
TENDER_SUMMARY("tenderSummary", "招标摘要"); |
|||
|
|||
private final String value; |
|||
private final String label; |
|||
|
|||
TenderTask(String value, String label) { |
|||
this.value = value; |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
package org.dromara.productManagement.mapper; |
|||
|
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
import org.dromara.productManagement.domain.ContractualTaskSupplement; |
|||
import org.dromara.productManagement.domain.vo.ContractualTaskSupplementVo; |
|||
|
|||
public interface ContractualTaskSupplementMapper extends BaseMapperPlus<ContractualTaskSupplement, ContractualTaskSupplementVo> { |
|||
} |
@ -0,0 +1,15 @@ |
|||
package org.dromara.productManagement.mapper; |
|||
|
|||
import org.dromara.productManagement.domain.SchemEvaluation; |
|||
import org.dromara.productManagement.domain.vo.SchemEvaluationVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 方案评价任务Mapper接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
public interface SchemEvaluationMapper extends BaseMapperPlus<SchemEvaluation, SchemEvaluationVo> { |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package org.dromara.productManagement.mapper; |
|||
|
|||
import org.dromara.productManagement.domain.TenderTask; |
|||
import org.dromara.productManagement.domain.vo.TenderTaskVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 招标摘要任务Mapper接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
public interface TenderTaskMapper extends BaseMapperPlus<TenderTask, TenderTaskVo> { |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
package org.dromara.productManagement.service; |
|||
|
|||
|
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.productManagement.domain.bo.ContractualTaskSupplementBo; |
|||
import org.dromara.productManagement.domain.vo.ContractualTaskSupplementVo; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
Service接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
public interface IContractualTaskSupplementService { |
|||
|
|||
/** |
|||
* 查询合同任务额外字段 |
|||
|
|||
* |
|||
* @param id 主键 |
|||
* @return 合同任务额外字段 |
|||
|
|||
*/ |
|||
ContractualTaskSupplementVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询合同任务额外字段 |
|||
列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 合同任务额外字段 |
|||
分页列表 |
|||
*/ |
|||
TableDataInfo<ContractualTaskSupplementVo> queryPageList(ContractualTaskSupplementBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的合同任务额外字段 |
|||
列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 合同任务额外字段 |
|||
列表 |
|||
*/ |
|||
List<ContractualTaskSupplementVo> queryList(ContractualTaskSupplementBo bo); |
|||
|
|||
/** |
|||
* 新增合同任务额外字段 |
|||
|
|||
* |
|||
* @param bo 合同任务额外字段 |
|||
|
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ContractualTaskSupplementBo bo); |
|||
|
|||
/** |
|||
* 修改合同任务额外字段 |
|||
|
|||
* |
|||
* @param bo 合同任务额外字段 |
|||
|
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ContractualTaskSupplementBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除合同任务额外字段 |
|||
信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
/** |
|||
* 根据合同id查询合同方角色 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
String queryContractPartyRole(String id); |
|||
} |
@ -0,0 +1,70 @@ |
|||
package org.dromara.productManagement.service; |
|||
|
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.domain.vo.SchemEvaluationVo; |
|||
import org.dromara.productManagement.domain.bo.SchemEvaluationBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 方案评价任务Service接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
public interface ISchemEvaluationService { |
|||
|
|||
/** |
|||
* 查询方案评价任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 方案评价任务 |
|||
*/ |
|||
DocumentTasksVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询方案评价任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 方案评价任务分页列表 |
|||
*/ |
|||
TableDataInfo<DocumentTasksVo> queryPageList(SchemEvaluationBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的方案评价任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 方案评价任务列表 |
|||
*/ |
|||
List<DocumentTasksVo> queryList(SchemEvaluationBo bo); |
|||
|
|||
/** |
|||
* 新增方案评价任务 |
|||
* |
|||
* @param bo 方案评价任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(SchemEvaluationBo bo) throws IOException, InterruptedException; |
|||
|
|||
/** |
|||
* 修改方案评价任务 |
|||
* |
|||
* @param bo 方案评价任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(SchemEvaluationBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除方案评价任务信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
@ -0,0 +1,70 @@ |
|||
package org.dromara.productManagement.service; |
|||
|
|||
import org.dromara.productManagement.domain.bo.TenderTaskBo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.domain.vo.TenderTaskVo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 招标摘要任务Service接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
public interface ITenderTaskService { |
|||
|
|||
/** |
|||
* 查询招标摘要任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 招标摘要任务 |
|||
*/ |
|||
DocumentTasksVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询招标摘要任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 招标摘要任务分页列表 |
|||
*/ |
|||
TableDataInfo<DocumentTasksVo> queryPageList(TenderTaskBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的招标摘要任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 招标摘要任务列表 |
|||
*/ |
|||
List<DocumentTasksVo> queryList(TenderTaskBo bo); |
|||
|
|||
/** |
|||
* 新增招标摘要任务 |
|||
* |
|||
* @param bo 招标摘要任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(TenderTaskBo bo) throws IOException, InterruptedException; |
|||
|
|||
/** |
|||
* 修改招标摘要任务 |
|||
* |
|||
* @param bo 招标摘要任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(TenderTaskBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除招标摘要任务信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
@ -0,0 +1,155 @@ |
|||
package org.dromara.productManagement.service.impl; |
|||
|
|||
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.productManagement.domain.ContractualTaskSupplement; |
|||
import org.dromara.productManagement.domain.bo.ContractualTaskSupplementBo; |
|||
import org.dromara.productManagement.domain.vo.ContractualTaskSupplementVo; |
|||
import org.dromara.productManagement.mapper.ContractualTaskSupplementMapper; |
|||
import org.dromara.productManagement.service.IContractualTaskSupplementService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 合同任务额外字段 |
|||
Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-21 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ContractualTaskSupplementServiceImpl implements IContractualTaskSupplementService { |
|||
|
|||
private final ContractualTaskSupplementMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询合同任务额外字段 |
|||
|
|||
* |
|||
* @param id 主键 |
|||
* @return 合同任务额外字段 |
|||
|
|||
*/ |
|||
@Override |
|||
public ContractualTaskSupplementVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询合同任务额外字段 |
|||
列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 合同任务额外字段 |
|||
分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ContractualTaskSupplementVo> queryPageList(ContractualTaskSupplementBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ContractualTaskSupplement> lqw = buildQueryWrapper(bo); |
|||
Page<ContractualTaskSupplementVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的合同任务额外字段 |
|||
列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 合同任务额外字段 |
|||
列表 |
|||
*/ |
|||
@Override |
|||
public List<ContractualTaskSupplementVo> queryList(ContractualTaskSupplementBo bo) { |
|||
LambdaQueryWrapper<ContractualTaskSupplement> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ContractualTaskSupplement> buildQueryWrapper(ContractualTaskSupplementBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ContractualTaskSupplement> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(bo.getDocumentTasksId() != null, ContractualTaskSupplement::getDocumentTasksId, bo.getDocumentTasksId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getContractPartyRole()), ContractualTaskSupplement::getContractPartyRole, bo.getContractPartyRole()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增合同任务额外字段 |
|||
|
|||
* |
|||
* @param bo 合同任务额外字段 |
|||
|
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ContractualTaskSupplementBo bo) { |
|||
ContractualTaskSupplement add = MapstructUtils.convert(bo, ContractualTaskSupplement.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改合同任务额外字段 |
|||
|
|||
* |
|||
* @param bo 合同任务额外字段 |
|||
|
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ContractualTaskSupplementBo bo) { |
|||
ContractualTaskSupplement update = MapstructUtils.convert(bo, ContractualTaskSupplement.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ContractualTaskSupplement entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除合同任务额外字段 |
|||
信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
|
|||
@Override |
|||
public String queryContractPartyRole(String id) { |
|||
|
|||
LambdaQueryWrapper<ContractualTaskSupplement> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(ContractualTaskSupplement::getDocumentTasksId, id); |
|||
ContractualTaskSupplement contractualTaskSupplement = baseMapper.selectOne(lqw); |
|||
if (contractualTaskSupplement == null) { |
|||
return null; |
|||
} |
|||
return contractualTaskSupplement.getContractPartyRole(); |
|||
} |
|||
} |
@ -0,0 +1,162 @@ |
|||
package org.dromara.productManagement.service.impl; |
|||
|
|||
import org.dromara.common.core.service.DictService; |
|||
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.productManagement.common.service.BaseTaskService; |
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.bo.BaseTaskBo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.enums.TaskEnum; |
|||
import org.dromara.productManagement.mapper.*; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsService; |
|||
import org.dromara.productManagement.utils.MyTimeUtils; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.dromara.system.service.ISysUserService; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.productManagement.domain.bo.SchemEvaluationBo; |
|||
import org.dromara.productManagement.domain.vo.SchemEvaluationVo; |
|||
import org.dromara.productManagement.domain.SchemEvaluation; |
|||
import org.dromara.productManagement.service.ISchemEvaluationService; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 方案评价任务Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2025-01-03 |
|||
*/ |
|||
|
|||
@Service |
|||
public class SchemEvaluationServiceImpl extends BaseTaskService implements ISchemEvaluationService { |
|||
|
|||
public SchemEvaluationServiceImpl(ISysOssService ossService, ISysUserService userService, ModelPromptsMapper modelPromptsMapper, ModelUserPromptssettingMapper modelUserPromptssettingMapper, DocumentTasksPermissionsMapper documentTasksPermissionsMapper, IDocumentTasksPermissionsService documentTasksPermissionsService, DictService dictTypeService, DocumentTasksMapper baseMapper) { |
|||
super(ossService, userService, modelPromptsMapper, modelUserPromptssettingMapper, documentTasksPermissionsMapper, documentTasksPermissionsService, dictTypeService, baseMapper); |
|||
} |
|||
@Autowired |
|||
private DocumentTasksMapper documentTasksMapper; |
|||
/** |
|||
* 查询方案评价任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 方案评价任务 |
|||
*/ |
|||
@Override |
|||
public DocumentTasksVo queryById(Long id){ |
|||
return super.queryById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询方案评价任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 方案评价任务分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<DocumentTasksVo> queryPageList(SchemEvaluationBo bo, PageQuery pageQuery) { |
|||
DocumentTasksBo documentTasksBo = new DocumentTasksBo(); |
|||
BeanUtils.copyProperties(bo, documentTasksBo); |
|||
|
|||
LambdaQueryWrapper<DocumentTasks> lqw = buildQueryWrapper(documentTasksBo); |
|||
lqw.eq(DocumentTasks::getTaskType, TaskEnum.TaskType.SCHEME_EVALUATION.getValue()); |
|||
Page<DocumentTasksVo> result = documentTasksMapper.selectVoPage(pageQuery.build(), lqw); |
|||
result.getRecords().forEach(vo -> { |
|||
Long createBy = vo.getCreateBy(); |
|||
vo.setCreateUser(userService.selectUserById(createBy).getNickName()); |
|||
// 格式化输出
|
|||
String formattedDuration=""; |
|||
if(!vo.getProgressStatus().equals("PENDING")&&!vo.getProgressStatus().equals("STARTED")){ |
|||
formattedDuration= MyTimeUtils.formatTimeDifference(vo.getCreateTime(), vo.getUpdateTime()); |
|||
} |
|||
vo.setTaskDuration(formattedDuration); |
|||
}); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的方案评价任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 方案评价任务列表 |
|||
*/ |
|||
@Override |
|||
public List<DocumentTasksVo> queryList(SchemEvaluationBo bo) { |
|||
DocumentTasksBo documentTasksBo = new DocumentTasksBo(); |
|||
BeanUtils.copyProperties(bo, documentTasksBo); |
|||
LambdaQueryWrapper<DocumentTasks> lqw = buildQueryWrapper(documentTasksBo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
// private LambdaQueryWrapper<SchemEvaluation> buildQueryWrapper(SchemEvaluationBo bo) {
|
|||
// Map<String, Object> params = bo.getParams();
|
|||
// LambdaQueryWrapper<SchemEvaluation> lqw = Wrappers.lambdaQuery();
|
|||
// lqw.eq(StringUtils.isNotBlank(bo.getTaskIndustry()), SchemEvaluation::getTaskIndustry, bo.getTaskIndustry());
|
|||
// lqw.eq(StringUtils.isNotBlank(bo.getTaskRegion()), SchemEvaluation::getTaskRegion, bo.getTaskRegion());
|
|||
// lqw.like(StringUtils.isNotBlank(bo.getTaskName()), SchemEvaluation::getTaskName, bo.getTaskName());
|
|||
// lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), SchemEvaluation::getDocumentName, bo.getDocumentName());
|
|||
// lqw.eq(StringUtils.isNotBlank(bo.getProgressStatus()), SchemEvaluation::getProgressStatus, bo.getProgressStatus());
|
|||
// return lqw;
|
|||
// }
|
|||
|
|||
/** |
|||
* 新增方案评价任务 |
|||
* |
|||
* @param bo 方案评价任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(SchemEvaluationBo bo) throws IOException, InterruptedException { |
|||
return handleTask(bo, TaskEnum.TaskType.SCHEME_EVALUATION.getValue()); |
|||
} |
|||
|
|||
/** |
|||
* 修改方案评价任务 |
|||
* |
|||
* @param bo 方案评价任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(SchemEvaluationBo bo) { |
|||
// SchemEvaluation update = MapstructUtils.convert(bo, SchemEvaluation.class);
|
|||
// validEntityBeforeSave(update);
|
|||
// return baseMapper.updateById(update) > 0;
|
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(SchemEvaluation 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,166 @@ |
|||
package org.dromara.productManagement.service.impl; |
|||
|
|||
import org.dromara.common.core.service.DictService; |
|||
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.productManagement.common.service.BaseTaskService; |
|||
import org.dromara.productManagement.domain.DocumentTasks; |
|||
import org.dromara.productManagement.domain.TenderTask; |
|||
import org.dromara.productManagement.domain.bo.ContractualTasksBo; |
|||
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|||
import org.dromara.productManagement.domain.bo.TenderTaskBo; |
|||
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|||
import org.dromara.productManagement.domain.vo.TenderTaskVo; |
|||
import org.dromara.productManagement.enums.TaskEnum; |
|||
import org.dromara.productManagement.mapper.*; |
|||
import org.dromara.productManagement.service.IDocumentTasksPermissionsService; |
|||
import org.dromara.productManagement.service.IDocumentTasksService; |
|||
import org.dromara.productManagement.utils.MyTimeUtils; |
|||
import org.dromara.system.service.ISysOssService; |
|||
import org.dromara.system.service.ISysUserService; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.productManagement.service.ITenderTaskService; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 招标摘要任务Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2024-12-31 |
|||
*/ |
|||
@Transactional |
|||
@Service |
|||
public class TenderTaskServiceImpl extends BaseTaskService implements ITenderTaskService { |
|||
|
|||
|
|||
public TenderTaskServiceImpl(ISysOssService ossService, ISysUserService userService, ModelPromptsMapper modelPromptsMapper, ModelUserPromptssettingMapper modelUserPromptssettingMapper, DocumentTasksPermissionsMapper documentTasksPermissionsMapper, IDocumentTasksPermissionsService documentTasksPermissionsService, DictService dictTypeService, DocumentTasksMapper baseMapper) { |
|||
super(ossService, userService, modelPromptsMapper, modelUserPromptssettingMapper, documentTasksPermissionsMapper, documentTasksPermissionsService, dictTypeService, baseMapper); |
|||
} |
|||
@Autowired |
|||
private DocumentTasksMapper documentTasksMapper; |
|||
@Autowired |
|||
private IDocumentTasksService documentTasksService; |
|||
|
|||
/** |
|||
* 查询招标摘要任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 招标摘要任务 |
|||
*/ |
|||
@Override |
|||
public DocumentTasksVo queryById(Long id) { |
|||
return null; |
|||
} |
|||
/** |
|||
* 分页查询招标摘要任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 招标摘要任务分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<DocumentTasksVo> queryPageList(TenderTaskBo bo, PageQuery pageQuery) { |
|||
DocumentTasksBo documentTasksBo = new DocumentTasksBo(); |
|||
BeanUtils.copyProperties(bo, documentTasksBo); |
|||
LambdaQueryWrapper<DocumentTasks> lqw = buildQueryWrapper(documentTasksBo); |
|||
lqw.eq(DocumentTasks::getTaskType, TaskEnum.TaskType.TENDER_REVIEW.getValue()); |
|||
Page<DocumentTasksVo> result = documentTasksMapper.selectVoPage(pageQuery.build(), lqw); |
|||
result.getRecords().forEach(vo -> { |
|||
Long createBy = vo.getCreateBy(); |
|||
vo.setCreateUser(userService.selectUserById(createBy).getNickName()); |
|||
//计算updateTime 和 createTime之间相差的小时数
|
|||
// 格式化输出
|
|||
String formattedDuration=""; |
|||
if(!vo.getProgressStatus().equals("PENDING")&&!vo.getProgressStatus().equals("STARTED")){ |
|||
formattedDuration= MyTimeUtils.formatTimeDifference(vo.getCreateTime(), vo.getUpdateTime()); |
|||
} |
|||
vo.setTaskDuration(formattedDuration); |
|||
}); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的招标摘要任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 招标摘要任务列表 |
|||
*/ |
|||
@Override |
|||
public List<DocumentTasksVo> queryList(TenderTaskBo bo) { |
|||
DocumentTasksBo documentTasksBo = new DocumentTasksBo(); |
|||
BeanUtils.copyProperties(bo, documentTasksBo); |
|||
|
|||
return documentTasksService.queryList(documentTasksBo); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<TenderTask> buildQueryWrapper(TenderTaskBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<TenderTask> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskIndustry()), TenderTask::getTaskIndustry, bo.getTaskIndustry()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTaskRegion()), TenderTask::getTaskRegion, bo.getTaskRegion()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getTaskName()), TenderTask::getTaskName, bo.getTaskName()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), TenderTask::getDocumentName, bo.getDocumentName()); |
|||
lqw.eq(bo.getOssId() != null, TenderTask::getOssId, bo.getOssId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getProgressStatus()), TenderTask::getProgressStatus, bo.getProgressStatus()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增招标摘要任务 |
|||
* |
|||
* @param bo 招标摘要任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(TenderTaskBo bo) throws IOException, InterruptedException { |
|||
return handleTask(bo, TaskEnum.TaskType.TENDER_REVIEW.getValue()); |
|||
} |
|||
|
|||
/** |
|||
* 修改招标摘要任务 |
|||
* |
|||
* @param bo 招标摘要任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(TenderTaskBo bo) { |
|||
TenderTask update = MapstructUtils.convert(bo, TenderTask.class); |
|||
validEntityBeforeSave(update); |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(TenderTask 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,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.productManagement.mapper.ContractualTaskSupplementMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.productManagement.mapper.SchemEvaluationMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.productManagement.mapper.TenderTaskMapper"> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue