[add] 添加设计原则,业主需求请求,设计变更,联系单变更、签证审批

This commit is contained in:
lcj
2025-07-09 14:13:58 +08:00
parent de2012140e
commit d51c0402ff
23 changed files with 451 additions and 127 deletions

View File

@ -119,11 +119,11 @@ security:
- /error - /error
- /*/api-docs - /*/api-docs
- /*/api-docs/** - /*/api-docs/**
- /warm-flow-ui/** - /warm-flow-ui/config
- /other/ys7Device/webhook - /other/ys7Device/webhook
# todo 仅测试 # todo 仅测试
- /facility/matrix/** - /facility/matrix/**
- /*/knowledgeDocument/changxie/callback/** - /**/changxie/callback/**
# 多租户配置 # 多租户配置
tenant: tenant:

View File

@ -1,26 +1,27 @@
package org.dromara.cory.controller; package org.dromara.cory.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import jakarta.validation.constraints.NotEmpty;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import jakarta.validation.constraints.NotNull;
import org.dromara.common.log.annotation.Log; import lombok.RequiredArgsConstructor;
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.domain.R;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup; import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.cory.domain.vo.BusContactnoticeVo; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.cory.domain.bo.BusContactnoticeBo; import org.dromara.common.log.annotation.Log;
import org.dromara.cory.service.IBusContactnoticeService; 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.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.cory.domain.bo.BusContactnoticeBo;
import org.dromara.cory.domain.vo.BusContactnoticeVo;
import org.dromara.cory.service.IBusContactnoticeService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 联系单 * 联系单
@ -75,8 +76,8 @@ public class BusContactnoticeController extends BaseController {
@Log(title = "联系单", businessType = BusinessType.INSERT) @Log(title = "联系单", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusContactnoticeBo bo) { public R<BusContactnoticeVo> add(@Validated(AddGroup.class) @RequestBody BusContactnoticeBo bo) {
return toAjax(busContactnoticeService.insertByBo(bo)); return R.ok(busContactnoticeService.insertByBo(bo));
} }
/** /**
@ -86,8 +87,8 @@ public class BusContactnoticeController extends BaseController {
@Log(title = "联系单", businessType = BusinessType.UPDATE) @Log(title = "联系单", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusContactnoticeBo bo) { public R<BusContactnoticeVo> edit(@Validated(EditGroup.class) @RequestBody BusContactnoticeBo bo) {
return toAjax(busContactnoticeService.updateByBo(bo)); return R.ok(busContactnoticeService.updateByBo(bo));
} }
/** /**

View File

@ -1,9 +1,10 @@
package org.dromara.cory.domain; package org.dromara.cory.domain;
import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial; import java.io.Serial;
@ -47,5 +48,9 @@ public class BusContactnotice extends BaseEntity {
*/ */
private String remark; private String remark;
/**
* 状态
*/
private String status;
} }

View File

@ -1,9 +1,9 @@
package org.dromara.cory.service; package org.dromara.cory.service;
import org.dromara.cory.domain.vo.BusContactnoticeVo;
import org.dromara.cory.domain.bo.BusContactnoticeBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.cory.domain.bo.BusContactnoticeBo;
import org.dromara.cory.domain.vo.BusContactnoticeVo;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -47,7 +47,7 @@ public interface IBusContactnoticeService {
* @param bo 联系单 * @param bo 联系单
* @return 是否新增成功 * @return 是否新增成功
*/ */
Boolean insertByBo(BusContactnoticeBo bo); BusContactnoticeVo insertByBo(BusContactnoticeBo bo);
/** /**
* 修改联系单 * 修改联系单
@ -55,7 +55,7 @@ public interface IBusContactnoticeService {
* @param bo 联系单 * @param bo 联系单
* @return 是否修改成功 * @return 是否修改成功
*/ */
Boolean updateByBo(BusContactnoticeBo bo); BusContactnoticeVo updateByBo(BusContactnoticeBo bo);
/** /**
* 校验并批量删除联系单信息 * 校验并批量删除联系单信息

View File

@ -1,9 +1,18 @@
package org.dromara.cory.service.impl; package org.dromara.cory.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
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.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.ObjectUtils; import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
@ -13,9 +22,12 @@ import org.dromara.cory.domain.bo.BusContactnoticeBo;
import org.dromara.cory.domain.vo.BusContactnoticeVo; import org.dromara.cory.domain.vo.BusContactnoticeVo;
import org.dromara.cory.mapper.BusContactnoticeMapper; import org.dromara.cory.mapper.BusContactnoticeMapper;
import org.dromara.cory.service.IBusContactnoticeService; import org.dromara.cory.service.IBusContactnoticeService;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -25,6 +37,7 @@ import java.util.Map;
* @author Lion Li * @author Lion Li
* @date 2025-07-03 * @date 2025-07-03
*/ */
@Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
public class BusContactnoticeServiceImpl implements IBusContactnoticeService { public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
@ -85,10 +98,17 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
* @return 是否新增成功 * @return 是否新增成功
*/ */
@Override @Override
public Boolean insertByBo(BusContactnoticeBo bo) { public BusContactnoticeVo insertByBo(BusContactnoticeBo bo) {
BusContactnotice add = MapstructUtils.convert(bo, BusContactnotice.class); BusContactnotice add = MapstructUtils.convert(bo, BusContactnotice.class);
if (add == null) {
throw new ServiceException("新增联系单失败,请求参数为空", HttpStatus.ERROR);
}
validEntityBeforeSave(add); validEntityBeforeSave(add);
return baseMapper.insert(add) > 0; int insert = baseMapper.insert(add);
if (insert <= 0) {
throw new ServiceException("新增联系单失败,请稍后重试", HttpStatus.ERROR);
}
return this.queryById(add.getId());
} }
/** /**
@ -98,10 +118,21 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
* @return 是否修改成功 * @return 是否修改成功
*/ */
@Override @Override
public Boolean updateByBo(BusContactnoticeBo bo) { public BusContactnoticeVo updateByBo(BusContactnoticeBo bo) {
BusContactnotice update = MapstructUtils.convert(bo, BusContactnotice.class); BusContactnotice update = MapstructUtils.convert(bo, BusContactnotice.class);
if (update == null) {
throw new ServiceException("修改联系单失败,请求参数为空", HttpStatus.ERROR);
}
validEntityBeforeSave(update); validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0; BusContactnotice busContactnotice = baseMapper.selectById(update.getId());
if (busContactnotice == null) {
throw new ServiceException("修改联系单失败,数据不存在", HttpStatus.ERROR);
}
int result = baseMapper.updateById(update);
if (result <= 0) {
throw new ServiceException("修改联系单失败,请稍后重试", HttpStatus.ERROR);
}
return this.queryById(update.getId());
} }
/** /**
@ -125,4 +156,55 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
} }
return baseMapper.deleteByIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
/**
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
* 正常使用只需#processEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processEvent 参数
*/
@EventListener(condition = "#processEvent.flowCode.endsWith('contact')")
public void processHandler(ProcessEvent processEvent) {
log.info("联系单审核任务执行了{}", processEvent.toString());
BusContactnotice contactnotice = baseMapper.selectById(Convert.toLong(processEvent.getBusinessId()));
contactnotice.setStatus(processEvent.getStatus());
if (processEvent.getSubmit()) {
contactnotice.setStatus(BusinessStatusEnum.WAITING.getStatus());
}
baseMapper.updateById(contactnotice);
}
/**
* 执行任务创建监听
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
* //执行业务逻辑
* }
*
* @param processTaskEvent 参数
*/
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('contact')")
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
log.info("联系单审核任务创建了{}", processTaskEvent.toString());
}
/**
* 监听删除流程事件
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processDeleteEvent 参数
*/
@Transactional
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('contact')")
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
log.info("监听删除流程事件,联系单审核任务执行了{}", processDeleteEvent.toString());
BusContactnotice contactnotice = baseMapper.selectById(Convert.toLong(processDeleteEvent.getBusinessId()));
if (ObjectUtil.isNull(contactnotice)) {
return;
}
this.deleteWithValidByIds(Collections.singleton(contactnotice.getId()), true);
}
} }

View File

@ -77,7 +77,7 @@ public class DesDesignChangeController extends BaseController {
@Log(title = "设计变更管理", businessType = BusinessType.INSERT) @Log(title = "设计变更管理", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
public R<Long> add(@Validated(AddGroup.class) @RequestBody DesDesignChangeCreateReq req) { public R<DesDesignChangeVo> add(@Validated(AddGroup.class) @RequestBody DesDesignChangeCreateReq req) {
return R.ok(desDesignChangeService.insertByBo(req)); return R.ok(desDesignChangeService.insertByBo(req));
} }
@ -88,8 +88,8 @@ public class DesDesignChangeController extends BaseController {
@Log(title = "设计变更管理", businessType = BusinessType.UPDATE) @Log(title = "设计变更管理", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DesDesignChangeUpdateReq req) { public R<DesDesignChangeVo> edit(@Validated(EditGroup.class) @RequestBody DesDesignChangeUpdateReq req) {
return toAjax(desDesignChangeService.updateByBo(req)); return R.ok(desDesignChangeService.updateByBo(req));
} }
/** /**

View File

@ -96,8 +96,8 @@ public class DesTechnicalStandardController extends BaseController {
@Log(title = "技术标准管理", businessType = BusinessType.INSERT) @Log(title = "技术标准管理", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping("/file") @PostMapping("/file")
public R<Void> add(@RequestPart("file") MultipartFile file, DesTechnicalStandardFileCreateReq req) { public R<DesTechnicalStandardVo> add(@RequestPart("file") MultipartFile file, DesTechnicalStandardFileCreateReq req) {
return toAjax(desTechnicalStandardService.insertFile(file, req)); return R.ok(desTechnicalStandardService.insertFile(file, req));
} }
/** /**
@ -107,8 +107,8 @@ public class DesTechnicalStandardController extends BaseController {
@Log(title = "技术标准管理", businessType = BusinessType.UPDATE) @Log(title = "技术标准管理", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping("/file") @PutMapping("/file")
public R<Void> edit(@RequestBody DesTechnicalStandardFileUpdateReq req) { public R<DesTechnicalStandardVo> edit(@RequestBody DesTechnicalStandardFileUpdateReq req) {
return toAjax(desTechnicalStandardService.updateFile(req)); return R.ok(desTechnicalStandardService.updateFile(req));
} }
/** /**

View File

@ -74,6 +74,11 @@ public class DesTechnicalStandard extends BaseEntity {
*/ */
private String originalName; private String originalName;
/**
* 审核状态
*/
private String status;
/** /**
* 备注 * 备注
*/ */

View File

@ -6,6 +6,7 @@ import org.dromara.design.domain.DesTechnicalStandard;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
@ -76,4 +77,14 @@ public class DesTechnicalStandardVo implements Serializable {
*/ */
private String remark; private String remark;
/**
* 审核状态
*/
private String status;
/**
* 创建时间
*/
private Date createTime;
} }

View File

@ -61,7 +61,7 @@ public interface IDesDesignChangeService extends IService<DesDesignChange> {
* @param req 设计变更管理 * @param req 设计变更管理
* @return 新增设计变更管理主键id * @return 新增设计变更管理主键id
*/ */
Long insertByBo(DesDesignChangeCreateReq req); DesDesignChangeVo insertByBo(DesDesignChangeCreateReq req);
/** /**
* 修改设计变更管理 * 修改设计变更管理
@ -69,7 +69,7 @@ public interface IDesDesignChangeService extends IService<DesDesignChange> {
* @param req 设计变更管理 * @param req 设计变更管理
* @return 是否修改成功 * @return 是否修改成功
*/ */
Boolean updateByBo(DesDesignChangeUpdateReq req); DesDesignChangeVo updateByBo(DesDesignChangeUpdateReq req);
/** /**
* 校验并批量删除设计变更管理信息 * 校验并批量删除设计变更管理信息

View File

@ -75,7 +75,7 @@ public interface IDesTechnicalStandardService extends IService<DesTechnicalStand
* @param req 技术标准管理 * @param req 技术标准管理
* @return 是否新增成功 * @return 是否新增成功
*/ */
Boolean insertFile(MultipartFile file, DesTechnicalStandardFileCreateReq req); DesTechnicalStandardVo insertFile(MultipartFile file, DesTechnicalStandardFileCreateReq req);
/** /**
* 新增技术标准管理文件夹 * 新增技术标准管理文件夹
@ -91,7 +91,7 @@ public interface IDesTechnicalStandardService extends IService<DesTechnicalStand
* @param req 技术标准管理 * @param req 技术标准管理
* @return 是否修改成功 * @return 是否修改成功
*/ */
Boolean updateFile(DesTechnicalStandardFileUpdateReq req); DesTechnicalStandardVo updateFile(DesTechnicalStandardFileUpdateReq req);
/** /**
* 删除技术标准管理文件信息 * 删除技术标准管理文件信息

View File

@ -1,7 +1,9 @@
package org.dromara.design.service.impl; package org.dromara.design.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -11,6 +13,10 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.xwpf.usermodel.*; import org.apache.poi.xwpf.usermodel.*;
import org.dromara.common.core.constant.HttpStatus; 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.core.exception.ServiceException;
import org.dromara.common.core.utils.ObjectUtils; import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
@ -33,6 +39,7 @@ import org.dromara.project.service.IBusProjectService;
import org.dromara.system.domain.vo.SysOssVo; import org.dromara.system.domain.vo.SysOssVo;
import org.dromara.system.service.ISysOssService; import org.dromara.system.service.ISysOssService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.context.event.EventListener;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -46,6 +53,7 @@ import java.nio.file.Paths;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
/** /**
@ -114,7 +122,10 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
public void exportWordById(Long id, HttpServletResponse response) { public void exportWordById(Long id, HttpServletResponse response) {
DesDesignChange designChange = this.getById(id); DesDesignChange designChange = this.getById(id);
if (designChange == null) { if (designChange == null) {
throw new ServiceException("质量-检查工单不存在"); throw new ServiceException("设计变更单不存在", HttpStatus.NOT_FOUND);
}
if (!designChange.getStatus().equals(BusinessStatusEnum.FINISH.getStatus())) {
throw new ServiceException("当前设计变更单审核未完成,无法下载", HttpStatus.CONFLICT);
} }
Map<String, String> replacementMap = getReplacementMap(designChange); Map<String, String> replacementMap = getReplacementMap(designChange);
Path targetDir = Paths.get(DesDesignConstant.getDesignChangeFileUrl(designChange)); Path targetDir = Paths.get(DesDesignConstant.getDesignChangeFileUrl(designChange));
@ -182,15 +193,15 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
* @return 新增设计变更管理主键id * @return 新增设计变更管理主键id
*/ */
@Override @Override
public Long insertByBo(DesDesignChangeCreateReq req) { public DesDesignChangeVo insertByBo(DesDesignChangeCreateReq req) {
DesDesignChange entity = new DesDesignChange(); DesDesignChange entity = new DesDesignChange();
BeanUtils.copyProperties(req, entity); BeanUtils.copyProperties(req, entity);
validEntityBeforeSave(entity, true); validEntityBeforeSave(entity, true);
boolean save = this.save(entity); boolean save = this.save(entity);
if (!save) { if (!save) {
throw new ServiceException("新增设计变更失败", HttpStatus.ERROR); throw new ServiceException("新增设计变更失败", HttpStatus.ERROR);
} }
return entity.getId(); return this.getVo(this.getById(entity.getId()));
} }
/** /**
@ -200,15 +211,19 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
* @return 是否修改成功 * @return 是否修改成功
*/ */
@Override @Override
public Boolean updateByBo(DesDesignChangeUpdateReq req) { public DesDesignChangeVo updateByBo(DesDesignChangeUpdateReq req) {
DesDesignChange oldDesignChange = this.getById(req.getId());
if (oldDesignChange == null) {
throw new ServiceException("设计变更单不存在", HttpStatus.NOT_FOUND);
}
DesDesignChange entity = new DesDesignChange(); DesDesignChange entity = new DesDesignChange();
BeanUtils.copyProperties(req, entity); BeanUtils.copyProperties(req, entity);
validEntityBeforeSave(entity, false); validEntityBeforeSave(entity, false);
boolean result = this.updateById(entity); boolean result = this.updateById(entity);
if (!result) { if (!result) {
throw new ServiceException("修改设计变更失败", HttpStatus.ERROR); throw new ServiceException("修改设计变更失败", HttpStatus.ERROR);
} }
return true; return this.getVo(this.getById(entity.getId()));
} }
@ -236,6 +251,39 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean deleteByIds(Collection<Long> ids) { public Boolean deleteByIds(Collection<Long> ids) {
List<DesDesignChange> designChangeList = this.listByIds(ids);
if (CollUtil.isEmpty(designChangeList)) {
return true;
}
// 关联删除附件
List<Long> fileIdList = designChangeList.stream()
.map(DesDesignChange::getFileId)
.filter(Objects::nonNull)
.map(Long::parseLong)
.toList();
List<Long> picList = designChangeList.stream()
.map(DesDesignChange::getAttachmentPic)
.filter(Objects::nonNull)
.flatMap(s -> Arrays.stream(s.split(",")))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.toList();
List<Long> costEstimationFileIdList = designChangeList.stream()
.map(DesDesignChange::getCostEstimationFile)
.filter(Objects::nonNull)
.flatMap(s -> Arrays.stream(s.split(",")))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.toList();
List<Long> ossIdList = Stream.of(fileIdList, picList, costEstimationFileIdList)
.flatMap(Collection::stream)
.distinct()
.toList();
if (CollUtil.isNotEmpty(ossIdList)) {
ossService.deleteWithValidByIds(ossIdList, true);
}
return removeBatchByIds(ids); return removeBatchByIds(ids);
} }
@ -364,7 +412,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
if (CollUtil.isEmpty(designChangeList)) { if (CollUtil.isEmpty(designChangeList)) {
return designChangeVoPage; return designChangeVoPage;
} }
Set<Long> ossIdList = designChangeList.stream().map(DesDesignChange::getFileId).map(Long::parseLong).collect(Collectors.toSet()); Set<Long> ossIdList = designChangeList.stream().map(DesDesignChange::getFileId).filter(Objects::nonNull).map(Long::parseLong).collect(Collectors.toSet());
List<SysOssVo> ossVoList = ossService.listByIds(ossIdList); List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
Map<Long, SysOssVo> ossVoMap = ossVoList.stream().collect(Collectors.toMap(SysOssVo::getOssId, Function.identity(), (a, b) -> a)); Map<Long, SysOssVo> ossVoMap = ossVoList.stream().collect(Collectors.toMap(SysOssVo::getOssId, Function.identity(), (a, b) -> a));
List<DesDesignChangeVo> designChangeVoList = designChangeList.stream().map(designChange -> { List<DesDesignChangeVo> designChangeVoList = designChangeList.stream().map(designChange -> {
@ -490,4 +538,55 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
} }
} }
} }
/**
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
* 正常使用只需#processEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processEvent 参数
*/
@EventListener(condition = "#processEvent.flowCode.endsWith('designchanged')")
public void processHandler(ProcessEvent processEvent) {
log.info("设计变更文件审核任务执行了{}", processEvent.toString());
DesDesignChange designChange = this.getById(Convert.toLong(processEvent.getBusinessId()));
designChange.setStatus(processEvent.getStatus());
if (processEvent.getSubmit()) {
designChange.setStatus(BusinessStatusEnum.WAITING.getStatus());
}
this.updateById(designChange);
}
/**
* 执行任务创建监听
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
* //执行业务逻辑
* }
*
* @param processTaskEvent 参数
*/
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('designchanged')")
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
log.info("设计变更文件审核任务创建了{}", processTaskEvent.toString());
}
/**
* 监听删除流程事件
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processDeleteEvent 参数
*/
@Transactional
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('designchanged')")
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
log.info("监听删除流程事件,设计变更文件审核任务执行了{}", processDeleteEvent.toString());
DesDesignChange designChange = this.getById(Convert.toLong(processDeleteEvent.getBusinessId()));
if (ObjectUtil.isNull(designChange)) {
return;
}
this.deleteByIds(Collections.singleton(designChange.getId()));
}
} }

View File

@ -125,6 +125,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public DesDrawingVo insertByBo(DesDrawingCreateReq req) { public DesDrawingVo insertByBo(DesDrawingCreateReq req) {
Long fileUrl = req.getFileUrl(); Long fileUrl = req.getFileUrl();
if (fileUrl == null) {
throw new ServiceException("图纸文件不能为空", HttpStatus.BAD_REQUEST);
}
SysOssVo ossVo = ossService.getById(fileUrl); SysOssVo ossVo = ossService.getById(fileUrl);
// 数据校验 // 数据校验
if (ObjectUtils.isEmpty(ossVo)) { if (ObjectUtils.isEmpty(ossVo)) {

View File

@ -61,26 +61,26 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
private WorkflowService workflowService; private WorkflowService workflowService;
/** /**
* 查询图纸管理 * 查询专项方案管理
* *
* @param id 主键 * @param id 主键
* @return 图纸管理 * @return 专项方案管理
*/ */
@Override @Override
public DesSpecialSchemeVo queryById(Long id) { public DesSpecialSchemeVo queryById(Long id) {
DesSpecialScheme specialScheme = this.getById(id); DesSpecialScheme specialScheme = this.getById(id);
if (specialScheme == null) { if (specialScheme == null) {
throw new ServiceException("图纸不存在", HttpStatus.NOT_FOUND); throw new ServiceException("专项方案不存在", HttpStatus.NOT_FOUND);
} }
return this.getVo(specialScheme); return this.getVo(specialScheme);
} }
/** /**
* 分页查询图纸管理列表 * 分页查询专项方案管理列表
* *
* @param req 查询条件 * @param req 查询条件
* @param pageQuery 分页参数 * @param pageQuery 分页参数
* @return 图纸管理分页列表 * @return 专项方案管理分页列表
*/ */
@Override @Override
public TableDataInfo<DesSpecialSchemeVo> queryPageList(DesSpecialSchemeQueryReq req, PageQuery pageQuery) { public TableDataInfo<DesSpecialSchemeVo> queryPageList(DesSpecialSchemeQueryReq req, PageQuery pageQuery) {
@ -90,10 +90,10 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
} }
/** /**
* 查询符合条件的图纸管理列表 * 查询符合条件的专项方案管理列表
* *
* @param req 查询条件 * @param req 查询条件
* @return 图纸管理列表 * @return 专项方案管理列表
*/ */
@Override @Override
public List<DesSpecialSchemeVo> queryList(DesSpecialSchemeQueryReq req) { public List<DesSpecialSchemeVo> queryList(DesSpecialSchemeQueryReq req) {
@ -102,10 +102,10 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
} }
/** /**
* 新增图纸管理 * 新增专项方案管理
* *
* @param req 图纸管理 * @param req 专项方案管理
* @return 新增图纸管理 * @return 新增专项方案管理
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -114,7 +114,7 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
SysOssVo ossVo = ossService.getById(fileUrl); SysOssVo ossVo = ossService.getById(fileUrl);
// 数据校验 // 数据校验
if (ObjectUtils.isEmpty(ossVo)) { if (ObjectUtils.isEmpty(ossVo)) {
throw new ServiceException("图纸文件不能为空", HttpStatus.BAD_REQUEST); throw new ServiceException("专项方案文件不能为空", HttpStatus.BAD_REQUEST);
} }
Long projectId = req.getProjectId(); Long projectId = req.getProjectId();
if (projectService.getById(projectId) == null) { if (projectService.getById(projectId) == null) {
@ -134,15 +134,15 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
desSpecialScheme.setVersionNumber(req.getVersionNumber()); desSpecialScheme.setVersionNumber(req.getVersionNumber());
boolean result = this.save(desSpecialScheme); boolean result = this.save(desSpecialScheme);
if (!result) { if (!result) {
throw new ServiceException("保存新图纸失败"); throw new ServiceException("保存新专项方案失败");
} }
return this.getVo(this.getById(desSpecialScheme.getId())); return this.getVo(this.getById(desSpecialScheme.getId()));
} }
/** /**
* 修改图纸管理 * 修改专项方案管理
* *
* @param req 图纸管理 * @param req 专项方案管理
* @return 是否修改成功 * @return 是否修改成功
*/ */
@Override @Override
@ -150,19 +150,19 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
Long id = req.getId(); Long id = req.getId();
DesSpecialScheme oldSpecialScheme = this.getById(id); DesSpecialScheme oldSpecialScheme = this.getById(id);
if (oldSpecialScheme == null) { if (oldSpecialScheme == null) {
throw new ServiceException("图纸不存在", HttpStatus.NOT_FOUND); throw new ServiceException("专项方案不存在", HttpStatus.NOT_FOUND);
} }
DesSpecialScheme desSpecialScheme = new DesSpecialScheme(); DesSpecialScheme desSpecialScheme = new DesSpecialScheme();
BeanUtils.copyProperties(req, desSpecialScheme); BeanUtils.copyProperties(req, desSpecialScheme);
boolean result = this.updateById(desSpecialScheme); boolean result = this.updateById(desSpecialScheme);
if (!result) { if (!result) {
throw new ServiceException("修改图纸失败", HttpStatus.ERROR); throw new ServiceException("修改专项方案失败", HttpStatus.ERROR);
} }
return this.getVo(this.getById(id)); return this.getVo(this.getById(id));
} }
/** /**
* 校验并批量删除图纸管理信息 * 校验并批量删除专项方案管理信息
* *
* @param ids 待删除的主键集合 * @param ids 待删除的主键集合
* @return 是否删除成功 * @return 是否删除成功
@ -172,7 +172,7 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
public Boolean deleteByIds(Collection<Long> ids) { public Boolean deleteByIds(Collection<Long> ids) {
List<DesSpecialScheme> specialSchemeList = this.listByIds(ids); List<DesSpecialScheme> specialSchemeList = this.listByIds(ids);
if (CollUtil.isEmpty(specialSchemeList)) { if (CollUtil.isEmpty(specialSchemeList)) {
throw new ServiceException("参数错误,请勿删除不存在的图纸", HttpStatus.BAD_REQUEST); throw new ServiceException("参数错误,请勿删除不存在的专项方案", HttpStatus.BAD_REQUEST);
} }
workflowService.deleteInstance((List<Long>) ids); workflowService.deleteInstance((List<Long>) ids);
// 删除oss文件 // 删除oss文件
@ -182,10 +182,10 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
} }
/** /**
* 构建图纸管理封装对象 * 构建专项方案管理封装对象
* *
* @param specialScheme 图纸管理 * @param specialScheme 专项方案管理
* @return 图纸管理封装对象 * @return 专项方案管理封装对象
*/ */
@Override @Override
public DesSpecialSchemeVo getVo(DesSpecialScheme specialScheme) { public DesSpecialSchemeVo getVo(DesSpecialScheme specialScheme) {
@ -224,10 +224,10 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
} }
/** /**
* 获取图纸管理对象视图 * 获取专项方案管理对象视图
* *
* @param specialSchemePage 图纸管理对象 * @param specialSchemePage 专项方案管理对象
* @return 图纸管理对象视图 * @return 专项方案管理对象视图
*/ */
@Override @Override
public Page<DesSpecialSchemeVo> getVoPage(Page<DesSpecialScheme> specialSchemePage) { public Page<DesSpecialSchemeVo> getVoPage(Page<DesSpecialScheme> specialSchemePage) {
@ -258,9 +258,9 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
* *
* @param processEvent 参数 * @param processEvent 参数
*/ */
@EventListener(condition = "#processEvent.flowCode.endsWith('specialScheme')") @EventListener(condition = "#processEvent.flowCode.endsWith('specialscheme')")
public void processHandler(ProcessEvent processEvent) { public void processHandler(ProcessEvent processEvent) {
log.info("图纸审核任务执行了{}", processEvent.toString()); log.info("专项方案审核任务执行了{}", processEvent.toString());
DesSpecialScheme specialScheme = this.getById(Convert.toLong(processEvent.getBusinessId())); DesSpecialScheme specialScheme = this.getById(Convert.toLong(processEvent.getBusinessId()));
specialScheme.setStatus(processEvent.getStatus()); specialScheme.setStatus(processEvent.getStatus());
if (processEvent.getSubmit()) { if (processEvent.getSubmit()) {
@ -279,9 +279,9 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
* *
* @param processTaskEvent 参数 * @param processTaskEvent 参数
*/ */
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('specialScheme')") @EventListener(condition = "#processTaskEvent.flowCode.endsWith('specialscheme')")
public void processTaskHandler(ProcessTaskEvent processTaskEvent) { public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
log.info("图纸审核任务创建了{}", processTaskEvent.toString()); log.info("专项方案审核任务创建了{}", processTaskEvent.toString());
} }
/** /**
@ -291,9 +291,9 @@ public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMap
* *
* @param processDeleteEvent 参数 * @param processDeleteEvent 参数
*/ */
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('specialScheme')") @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('specialscheme')")
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) { public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
log.info("监听删除流程事件,图纸审核任务执行了{}", processDeleteEvent.toString()); log.info("监听删除流程事件,专项方案审核任务执行了{}", processDeleteEvent.toString());
DesSpecialScheme specialScheme = this.getById(Convert.toLong(processDeleteEvent.getBusinessId())); DesSpecialScheme specialScheme = this.getById(Convert.toLong(processDeleteEvent.getBusinessId()));
if (ObjectUtil.isNull(specialScheme)) { if (ObjectUtil.isNull(specialScheme)) {
return; return;

View File

@ -1,6 +1,7 @@
package org.dromara.design.service.impl; package org.dromara.design.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
@ -13,7 +14,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.constant.HttpStatus; 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.core.exception.ServiceException;
import org.dromara.common.core.utils.*; import org.dromara.common.core.utils.*;
import org.dromara.common.enums.DocumentStatusEnum; import org.dromara.common.enums.DocumentStatusEnum;
@ -36,6 +42,7 @@ import org.dromara.project.service.IBusProjectService;
import org.dromara.system.domain.vo.SysOssUploadVo; import org.dromara.system.domain.vo.SysOssUploadVo;
import org.dromara.system.service.ISysOssService; import org.dromara.system.service.ISysOssService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -51,6 +58,7 @@ import java.util.stream.Collectors;
* @author lcj * @author lcj
* @date 2025-07-02 * @date 2025-07-02
*/ */
@Slf4j
@Service @Service
public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalStandardMapper, DesTechnicalStandard> public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalStandardMapper, DesTechnicalStandard>
implements IDesTechnicalStandardService { implements IDesTechnicalStandardService {
@ -175,7 +183,7 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
* @return 是否新增成功 * @return 是否新增成功
*/ */
@Override @Override
public Boolean insertFile(MultipartFile file, DesTechnicalStandardFileCreateReq req) { public DesTechnicalStandardVo insertFile(MultipartFile file, DesTechnicalStandardFileCreateReq req) {
// 数据校验 // 数据校验
if (ObjectUtils.isEmpty(file)) { if (ObjectUtils.isEmpty(file)) {
throw new ServiceException("技术标准管理文件不能为空", HttpStatus.BAD_REQUEST); throw new ServiceException("技术标准管理文件不能为空", HttpStatus.BAD_REQUEST);
@ -222,7 +230,7 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
if (!save) { if (!save) {
throw new ServiceException("新增文件失败,数据库异常", HttpStatus.ERROR); throw new ServiceException("新增文件失败,数据库异常", HttpStatus.ERROR);
} }
return true; return this.getVo(this.getById(desTechnicalStandard.getId()));
} }
/** /**
@ -269,7 +277,7 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
* @return 是否修改成功 * @return 是否修改成功
*/ */
@Override @Override
public Boolean updateFile(DesTechnicalStandardFileUpdateReq req) { public DesTechnicalStandardVo updateFile(DesTechnicalStandardFileUpdateReq req) {
Long id = req.getId(); Long id = req.getId();
DesTechnicalStandard oldDocument = this.getById(id); DesTechnicalStandard oldDocument = this.getById(id);
if (oldDocument == null) { if (oldDocument == null) {
@ -281,7 +289,7 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
if (!result) { if (!result) {
throw new ServiceException("修改技术标准管理文件失败", HttpStatus.ERROR); throw new ServiceException("修改技术标准管理文件失败", HttpStatus.ERROR);
} }
return true; return this.getVo(this.getById(id));
} }
/** /**
@ -513,4 +521,59 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
// 返回合并后去重的结果 // 返回合并后去重的结果
return allParentIds.stream().distinct().collect(Collectors.toList()); return allParentIds.stream().distinct().collect(Collectors.toList());
} }
/**
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
* 正常使用只需#processEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processEvent 参数
*/
@EventListener(condition = "#processEvent.flowCode.endsWith('technical')")
public void processHandler(ProcessEvent processEvent) {
log.info("技术标准文件审核任务执行了{}", processEvent.toString());
DesTechnicalStandard technicalStandard = this.getById(Convert.toLong(processEvent.getBusinessId()));
technicalStandard.setStatus(processEvent.getStatus());
if (processEvent.getSubmit()) {
technicalStandard.setStatus(BusinessStatusEnum.WAITING.getStatus());
}
this.updateById(technicalStandard);
}
/**
* 执行任务创建监听
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
* //执行业务逻辑
* }
*
* @param processTaskEvent 参数
*/
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('technical')")
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
log.info("技术标准文件审核任务创建了{}", processTaskEvent.toString());
}
/**
* 监听删除流程事件
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processDeleteEvent 参数
*/
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('technical')")
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
log.info("监听删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
DesTechnicalStandard technicalStandard = this.getById(Convert.toLong(processDeleteEvent.getBusinessId()));
if (ObjectUtil.isNull(technicalStandard)) {
return;
}
String fileUrl = technicalStandard.getFileUrl();
if (StringUtils.isNotBlank(fileUrl)) {
OssClient storage = OssFactory.instance();
storage.delete(fileUrl);
}
this.removeById(technicalStandard.getId());
}
} }

View File

@ -1,13 +1,16 @@
package org.dromara.drone.domain.bo; package org.dromara.drone.domain.bo;
import org.dromara.drone.domain.DroDroneConfig;
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 io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.drone.domain.DroDroneConfig;
import java.io.Serial;
/** /**
* 无人机配置业务对象 dro_drone_config * 无人机配置业务对象 dro_drone_config
@ -20,6 +23,9 @@ import jakarta.validation.constraints.*;
@AutoMapper(target = DroDroneConfig.class, reverseConvertGenerate = false) @AutoMapper(target = DroDroneConfig.class, reverseConvertGenerate = false)
public class DroDroneConfigBo extends BaseEntity { public class DroDroneConfigBo extends BaseEntity {
@Serial
private static final long serialVersionUID = -814870483546946548L;
/** /**
* 主键id * 主键id
*/ */

View File

@ -1,17 +1,13 @@
package org.dromara.drone.domain.vo; package org.dromara.drone.domain.vo;
import org.dromara.drone.domain.DroDroneConfig;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; 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 io.github.linpeilie.annotations.AutoMapper;
import lombok.Data; import lombok.Data;
import org.dromara.drone.domain.DroDroneConfig;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**

View File

@ -1,23 +1,22 @@
package org.dromara.drone.service.impl; package org.dromara.drone.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.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.drone.domain.DroDroneConfig;
import org.dromara.drone.domain.bo.DroDroneConfigBo; import org.dromara.drone.domain.bo.DroDroneConfigBo;
import org.dromara.drone.domain.vo.DroDroneConfigVo; import org.dromara.drone.domain.vo.DroDroneConfigVo;
import org.dromara.drone.domain.DroDroneConfig;
import org.dromara.drone.mapper.DroDroneConfigMapper; import org.dromara.drone.mapper.DroDroneConfigMapper;
import org.dromara.drone.service.IDroDroneConfigService; import org.dromara.drone.service.IDroDroneConfigService;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection;
/** /**
* 无人机配置Service业务层处理 * 无人机配置Service业务层处理

View File

@ -1,7 +1,5 @@
package org.dromara.project.domain; package org.dromara.project.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -9,8 +7,6 @@ import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/** /**
* 黑名单对象 bus_construction_blacklist * 黑名单对象 bus_construction_blacklist

View File

@ -53,7 +53,7 @@ import org.dromara.safety.service.IHseKnowledgeDocumentService;
import org.dromara.system.domain.bo.SysDeptBo; import org.dromara.system.domain.bo.SysDeptBo;
import org.dromara.system.domain.vo.SysDeptVo; import org.dromara.system.domain.vo.SysDeptVo;
import org.dromara.system.service.ISysDeptService; import org.dromara.system.service.ISysDeptService;
import org.dromara.system.service.ISysPostService; import org.dromara.workflow.service.IFlwDefinitionService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
@ -103,9 +103,6 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
@Resource @Resource
private ISysDeptService deptService; private ISysDeptService deptService;
@Resource
private ISysPostService postService;
@Lazy @Lazy
@Resource @Resource
private IHseKnowledgeDocumentService hseKnowledgeDocumentService; private IHseKnowledgeDocumentService hseKnowledgeDocumentService;
@ -118,6 +115,9 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
@Resource @Resource
private IDesTechnicalStandardService desTechnicalStandardService; private IDesTechnicalStandardService desTechnicalStandardService;
@Resource
private IFlwDefinitionService flwDefinitionService;
@Lazy @Lazy
@Resource @Resource
private IBusProjectService self; private IBusProjectService self;
@ -442,11 +442,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
if (!saveTechnicalStandard) { if (!saveTechnicalStandard) {
log.error("同步数据失败,项目[{}]新增技术标准管理文件夹模版失败", id); log.error("同步数据失败,项目[{}]新增技术标准管理文件夹模版失败", id);
} }
// 新增岗位 flwDefinitionService.insertDefByProjectId(id);
Boolean postR = postService.insertPostByDeptId(project.getDeptId());
if (!postR) {
throw new ServiceException("对应岗位类型保存失败");
}
return CompletableFuture.completedFuture(true); return CompletableFuture.completedFuture(true);
} }

View File

@ -0,0 +1,33 @@
package org.dromara.workflow.common.enums;
import lombok.Getter;
/**
* @author lcj
* @date 2025/7/8 19:22
*/
@Getter
public enum FlwDefinitionSuffixTemplateEnum {
FLOW_DESIGN_PHILOSOPHY("设计原则审批", "_principletechnical", ""),
FLOW_REQUIREMENTS_LIST("业主需求清单审批", "_requirementstechnical", ""),
FLOW_SPECIAL_SCHEME("专项方案审批", "_specialscheme", "specialScheme/indexEdit"),
FLOW_PROCESS_DRAWING("过程图纸审批", "_processdrawing", "drawing/indexEdit"),
FLOW_BLUEPRINT_DRAWING("蓝图审批", "_blueprintdrawing", "drawing/indexEdit"),
FLOW_CHANGED_DRAWING("变更图纸审批", "_changedrawing", "drawing/indexEdit"),
FLOW_DESIGN_CHANGED("设计变更审批", "_designchanged", "designChange/indexEdit"),
FLOW_CHANGED_CONTACT("变更联系单审批", "_changecontact", ""),
FLOW_VISA_CONTACT("签证联系单审批", "_visacontact", "");
private final String name;
private final String code;
private final String path;
FlwDefinitionSuffixTemplateEnum(String name, String code, String path) {
this.name = name;
this.code = code;
this.path = path;
}
}

View File

@ -69,6 +69,13 @@ public interface IFlwDefinitionService {
*/ */
boolean removeDef(List<Long> ids); boolean removeDef(List<Long> ids);
/**
* 新增流程定义
*
* @param projectId 项目id
*/
void insertDefByProjectId(Long projectId);
/** /**
* 新增租户流程定义 * 新增租户流程定义
* *

View File

@ -30,6 +30,7 @@ import org.dromara.warm.flow.orm.mapper.FlowNodeMapper;
import org.dromara.warm.flow.orm.mapper.FlowSkipMapper; import org.dromara.warm.flow.orm.mapper.FlowSkipMapper;
import org.dromara.workflow.common.ConditionalOnEnable; import org.dromara.workflow.common.ConditionalOnEnable;
import org.dromara.workflow.common.constant.FlowConstant; import org.dromara.workflow.common.constant.FlowConstant;
import org.dromara.workflow.common.enums.FlwDefinitionSuffixTemplateEnum;
import org.dromara.workflow.domain.FlowCategory; import org.dromara.workflow.domain.FlowCategory;
import org.dromara.workflow.domain.bo.FlowDefinitionBo; import org.dromara.workflow.domain.bo.FlowDefinitionBo;
import org.dromara.workflow.domain.vo.FlowDefinitionVo; import org.dromara.workflow.domain.vo.FlowDefinitionVo;
@ -202,6 +203,27 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService {
return true; return true;
} }
/**
* 新增流程定义
*
* @param projectId 项目id
*/
@Override
public void insertDefByProjectId(Long projectId) {
FlwDefinitionSuffixTemplateEnum[] suffixList = FlwDefinitionSuffixTemplateEnum.values();
for (FlwDefinitionSuffixTemplateEnum suffix : suffixList) {
FlowDefinition definition = new FlowDefinition();
definition.setCategory("100");
definition.setFlowCode(projectId + suffix.getCode());
definition.setFlowName(suffix.getName());
definition.setFormPath(suffix.getPath());
boolean result = defService.checkAndSave(definition);
if (!result) {
log.info("流程定义[{}-{}]失败!", suffix.getName(), projectId + suffix.getCode());
}
}
}
/** /**
* 新增租户流程定义 * 新增租户流程定义
* *