feat:报告流程回调、手写签名

This commit is contained in:
FCL
2025-10-29 15:27:03 +08:00
parent 2529349399
commit 92529782f8
20 changed files with 620 additions and 12 deletions

View File

@@ -58,6 +58,9 @@ public class BusinessAssayReportDataPageReqVO extends PageParam {
//==================扩展字段===========
@Schema(description = "id列表")
private List<Long> idList;
@Schema(description = "样品名称")
private String sampleName;

View File

@@ -0,0 +1,117 @@
package com.zt.plat.module.qms.business.config.controller.admin;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
@Tag(name = "管理后台 - 手写签名配置")
@RestController
@RequestMapping("/qms/config-user-signature")
@Validated
@FileUploadController(source = "qms.configusersignature")
public class ConfigUserSignatureController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = ConfigUserSignatureController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private ConfigUserSignatureService configUserSignatureService;
@PostMapping("/create")
@Operation(summary = "创建手写签名配置")
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:create')")
public CommonResult<ConfigUserSignatureRespVO> createConfigUserSignature(@Valid @RequestBody ConfigUserSignatureSaveReqVO createReqVO) {
return success(configUserSignatureService.createConfigUserSignature(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新手写签名配置")
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:update')")
public CommonResult<Boolean> updateConfigUserSignature(@Valid @RequestBody ConfigUserSignatureSaveReqVO updateReqVO) {
configUserSignatureService.updateConfigUserSignature(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除手写签名配置")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:delete')")
public CommonResult<Boolean> deleteConfigUserSignature(@RequestParam("id") Long id) {
configUserSignatureService.deleteConfigUserSignature(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除手写签名配置")
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:delete')")
public CommonResult<Boolean> deleteConfigUserSignatureList(@RequestBody BatchDeleteReqVO req) {
configUserSignatureService.deleteConfigUserSignatureListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得手写签名配置")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ConfigUserSignatureRespVO> getConfigUserSignature(@RequestParam("id") Long id) {
ConfigUserSignatureDO configUserSignature = configUserSignatureService.getConfigUserSignature(id);
return success(BeanUtils.toBean(configUserSignature, ConfigUserSignatureRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得手写签名配置分页")
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:query')")
public CommonResult<PageResult<ConfigUserSignatureRespVO>> getConfigUserSignaturePage(@Valid ConfigUserSignaturePageReqVO pageReqVO) {
PageResult<ConfigUserSignatureDO> pageResult = configUserSignatureService.getConfigUserSignaturePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ConfigUserSignatureRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出手写签名配置 Excel")
@PreAuthorize("@ss.hasPermission('qms:config-user-signature:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportConfigUserSignatureExcel(@Valid ConfigUserSignaturePageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ConfigUserSignatureDO> list = configUserSignatureService.getConfigUserSignaturePage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "手写签名配置.xls", "数据", ConfigUserSignatureRespVO.class,
BeanUtils.toBean(list, ConfigUserSignatureRespVO.class));
}
}

View File

@@ -0,0 +1,40 @@
package com.zt.plat.module.qms.business.config.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 手写签名配置分页 Request VO")
@Data
public class ConfigUserSignaturePageReqVO extends PageParam {
@Schema(description = "用户id", example = "2926")
private String userId;
@Schema(description = "用户姓名", example = "赵六")
private String userName;
@Schema(description = "文件id", example = "9170")
private Long fileId;
@Schema(description = "签名内容")
private String signatureContent;
@Schema(description = "禁用标识")
private Integer cancelFlag;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,50 @@
package com.zt.plat.module.qms.business.config.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 手写签名配置 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ConfigUserSignatureRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17765")
@ExcelProperty("ID")
private Long id;
@Schema(description = "用户id", example = "2926")
@ExcelProperty("用户id")
private String userId;
@Schema(description = "用户姓名", example = "赵六")
@ExcelProperty("用户姓名")
private String userName;
@Schema(description = "文件id", example = "9170")
@ExcelProperty("文件id")
private Long fileId;
@Schema(description = "签名内容")
@ExcelProperty("签名内容")
private String signatureContent;
@Schema(description = "禁用标识")
@ExcelProperty("禁用标识")
private Integer cancelFlag;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.qms.business.config.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 手写签名配置新增/修改 Request VO")
@Data
public class ConfigUserSignatureSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17765")
private Long id;
@Schema(description = "用户id", example = "2926")
private String userId;
@Schema(description = "用户姓名", example = "赵六")
private String userName;
@Schema(description = "文件id", example = "9170")
private Long fileId;
@Schema(description = "签名内容")
private String signatureContent;
@Schema(description = "禁用标识")
private Integer cancelFlag;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,67 @@
package com.zt.plat.module.qms.business.config.dal.dataobject;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 手写签名配置 DO
*
* @author 后台管理
*/
@TableName("t_cfg_user_sig")
@KeySequence("t_cfg_user_sig_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ConfigUserSignatureDO extends BusinessBaseDO {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 用户id
*/
@TableField("USER_ID")
private String userId;
/**
* 用户姓名
*/
@TableField("USER_NAME")
private String userName;
/**
* 文件id
*/
@TableField("FILE_ID")
private Long fileId;
/**
* 签名内容
*/
@TableField("SIG_CNTT")
private String signatureContent;
/**
* 禁用标识
*/
@TableField("CNL_FLG")
private Integer cancelFlag;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.qms.business.config.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 手写签名配置 Mapper
*
* @author 后台管理
*/
@Mapper
public interface ConfigUserSignatureMapper extends BaseMapperX<ConfigUserSignatureDO> {
default PageResult<ConfigUserSignatureDO> selectPage(ConfigUserSignaturePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigUserSignatureDO>()
.eqIfPresent(ConfigUserSignatureDO::getUserId, reqVO.getUserId())
.likeIfPresent(ConfigUserSignatureDO::getUserName, reqVO.getUserName())
.eqIfPresent(ConfigUserSignatureDO::getFileId, reqVO.getFileId())
.eqIfPresent(ConfigUserSignatureDO::getSignatureContent, reqVO.getSignatureContent())
.eqIfPresent(ConfigUserSignatureDO::getCancelFlag, reqVO.getCancelFlag())
.eqIfPresent(ConfigUserSignatureDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(ConfigUserSignatureDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ConfigUserSignatureDO::getRemark, reqVO.getRemark())
.orderByDesc(ConfigUserSignatureDO::getId));
}
}

View File

@@ -0,0 +1,66 @@
package com.zt.plat.module.qms.business.config.service;
import java.util.*;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO;
import jakarta.validation.*;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import com.zt.plat.framework.common.pojo.PageResult;
/**
* 手写签名配置 Service 接口
*
* @author 后台管理
*/
public interface ConfigUserSignatureService {
ConfigUserSignatureDO getByUserId(Long userId);
/**
* 创建手写签名配置
*
* @param createReqVO 创建信息
* @return 编号
*/
ConfigUserSignatureRespVO createConfigUserSignature(@Valid ConfigUserSignatureSaveReqVO createReqVO);
/**
* 更新手写签名配置
*
* @param updateReqVO 更新信息
*/
void updateConfigUserSignature(@Valid ConfigUserSignatureSaveReqVO updateReqVO);
/**
* 删除手写签名配置
*
* @param id 编号
*/
void deleteConfigUserSignature(Long id);
/**
* 批量删除手写签名配置
*
* @param ids 编号
*/
void deleteConfigUserSignatureListByIds(List<Long> ids);
/**
* 获得手写签名配置
*
* @param id 编号
* @return 手写签名配置
*/
ConfigUserSignatureDO getConfigUserSignature(Long id);
/**
* 获得手写签名配置分页
*
* @param pageReqVO 分页查询
* @return 手写签名配置分页
*/
PageResult<ConfigUserSignatureDO> getConfigUserSignaturePage(ConfigUserSignaturePageReqVO pageReqVO);
}

View File

@@ -0,0 +1,103 @@
package com.zt.plat.module.qms.business.config.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigUserSignatureMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_USER_SIGNATURE_NOT_EXISTS;
/**
* 手写签名配置 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class ConfigUserSignatureServiceImpl implements ConfigUserSignatureService {
@Resource
private ConfigUserSignatureMapper configUserSignatureMapper;
@Override
public ConfigUserSignatureDO getByUserId(Long userId) {
LambdaQueryWrapper<ConfigUserSignatureDO> query = new LambdaQueryWrapper<>();
query.eq(ConfigUserSignatureDO::getUserId, userId)
.eq(ConfigUserSignatureDO::getCancelFlag, 0);
query.orderByDesc(ConfigUserSignatureDO::getUpdateTime);
List<ConfigUserSignatureDO> list = configUserSignatureMapper.selectList(query);
return CollUtil.isEmpty(list) ? null : list.get(0);
}
@Override
public ConfigUserSignatureRespVO createConfigUserSignature(ConfigUserSignatureSaveReqVO createReqVO) {
// 插入
ConfigUserSignatureDO configUserSignature = BeanUtils.toBean(createReqVO, ConfigUserSignatureDO.class);
configUserSignatureMapper.insert(configUserSignature);
// 返回
return BeanUtils.toBean(configUserSignature, ConfigUserSignatureRespVO.class);
}
@Override
public void updateConfigUserSignature(ConfigUserSignatureSaveReqVO updateReqVO) {
// 校验存在
validateConfigUserSignatureExists(updateReqVO.getId());
// 更新
ConfigUserSignatureDO updateObj = BeanUtils.toBean(updateReqVO, ConfigUserSignatureDO.class);
configUserSignatureMapper.updateById(updateObj);
}
@Override
public void deleteConfigUserSignature(Long id) {
// 校验存在
validateConfigUserSignatureExists(id);
// 删除
configUserSignatureMapper.deleteById(id);
}
@Override
public void deleteConfigUserSignatureListByIds(List<Long> ids) {
// 校验存在
validateConfigUserSignatureExists(ids);
// 删除
configUserSignatureMapper.deleteByIds(ids);
}
private void validateConfigUserSignatureExists(List<Long> ids) {
List<ConfigUserSignatureDO> list = configUserSignatureMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(CONFIG_USER_SIGNATURE_NOT_EXISTS);
}
}
private void validateConfigUserSignatureExists(Long id) {
if (configUserSignatureMapper.selectById(id) == null) {
throw exception(CONFIG_USER_SIGNATURE_NOT_EXISTS);
}
}
@Override
public ConfigUserSignatureDO getConfigUserSignature(Long id) {
return configUserSignatureMapper.selectById(id);
}
@Override
public PageResult<ConfigUserSignatureDO> getConfigUserSignaturePage(ConfigUserSignaturePageReqVO pageReqVO) {
return configUserSignatureMapper.selectPage(pageReqVO);
}
}

View File

@@ -37,6 +37,8 @@ public interface ReportDocumentDataService {
CommonResult<String> insertBatch(List<ReportDocumentDataDO> list);
void deleteByMainId(Long mainId);
/**
* 更新检测报告明细
*

View File

@@ -324,6 +324,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
return CommonResult.success("移除成功");
}
@Override
public void deleteByMainId(Long mainId) {
QueryWrapper<ReportDocumentDataDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("MAIN_ID", mainId);
reportDocumentDataMapper.delete(queryWrapper);
}
@Override
public ReportDocumentDataRespVO createReportDocumentData(ReportDocumentDataSaveReqVO createReqVO) {
// 插入

View File

@@ -20,6 +20,8 @@ public interface ReportDocumentMainCorrelationService {
List<ReportDocumentMainCorrelationDO> listByMainId(Long mainId);
void deleteByMainId(Long mainId);
/**
* 创建检测报告关系表
*

View File

@@ -51,6 +51,14 @@ public class ReportDocumentMainCorrelationServiceImpl implements ReportDocumentM
return BeanUtils.toBean(reportDocumentMainCorrelation, ReportDocumentMainCorrelationRespVO.class);
}
@Override
public void deleteByMainId(Long mainId) {
LambdaQueryWrapper<ReportDocumentMainCorrelationDO> query = new LambdaQueryWrapper<>();
query.eq(ReportDocumentMainCorrelationDO::getMainId, mainId);
reportDocumentMainCorrelationMapper.delete(query);
}
@Override
public void updateReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO updateReqVO) {
// 校验存在

View File

@@ -14,6 +14,8 @@ import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO;
@@ -22,6 +24,7 @@ import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMa
import com.zt.plat.module.qms.enums.QmsBpmConstant;
import com.zt.plat.module.qms.enums.QmsCommonConstant;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@@ -46,6 +49,7 @@ import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME
*/
@Service("reportDocumentMainService")
@Validated
@Slf4j
public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, BMPCallbackInterface {
@Resource private ReportDocumentMainMapper reportDocumentMainMapper;
@@ -53,6 +57,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
@Resource private ReportDocumentDataService reportDocumentDataService;
@Resource private BpmProcessInstanceApi bpmProcessInstanceApi;
@Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService;
@Resource private ConfigUserSignatureService configUserSignatureService;
/***
* 增加报表数据(按样品)
* 传入报告id、 报表数据ids
@@ -83,7 +88,13 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
}
if(isExist)
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "报表数据已在本报告使用,请勿重复添加");
List<BusinessAssayReportDataDO> assayReportDataList = businessAssayReportDataService.listByIds(addReportDataIdList);
// List<BusinessAssayReportDataDO> assayReportDataList = businessAssayReportDataService.listByIds(addReportDataIdList);
BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO();
reportDataQueryVo.setIdList(addReportDataIdList);
reportDataQueryVo.setPageNo(1);
reportDataQueryVo.setPageSize(9999);
PageResult<BusinessAssayReportDataDO> assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo);
List<BusinessAssayReportDataDO> assayReportDataList = assayReportPage.getList();
return execAddByBusinessAssayReportData(assayReportDataList, id);
}
@@ -208,11 +219,15 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteReportDocumentMain(Long id) {
// 校验存在
validateReportDocumentMainExists(id);
// 删除
reportDocumentMainMapper.deleteById(id);
//删除关联表
reportDocumentMainCorrelationService.deleteByMainId(id);
reportDocumentDataService.deleteByMainId(id);
}
@Override
@@ -288,24 +303,58 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
@Transactional(rollbackFor = Exception.class)
public CommonResult<JSONObject> callback(QmsBpmDTO reqDTO) {
JSONObject variables = reqDTO.getVariables();
//流程状态 3-拒绝 1-通过 2-完成
//流程状态 3-拒绝 1-通过 2-完成 4-取消流程
String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS);
String mainId = variables.getString("mainId");
ReportDocumentMainDO entity = getReportDocumentMain(Long.valueOf(mainId));
if("3".equals(PROCESS_STATUS)){
//终止
entity.setFlowStatus(QmsCommonConstant.REJECT);
log.error("流程回调:{}", JSONObject.toJSONString(reqDTO));
String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID);
String RETURN_FLAG_PREFIX_KEY = variables.getString(QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY);
String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001";
// if("3".equals(PROCESS_STATUS)){
//"RETURN_FLAG_Activity_001": true 标识驳回到发起环节
if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){
//拒绝(重制)
entity.setFlowStatus(QmsCommonConstant.REJECTED);
entity.setDocumentSignature("");
}
if("2".equals(PROCESS_STATUS)){
else if("2".equals(PROCESS_STATUS)){
//完成
entity.setFlowStatus(QmsCommonConstant.COMPLETED);
assembleSignature(currentActivityId, entity);
}
else if("4".equals(PROCESS_STATUS)){
//作废
entity.setFlowStatus(QmsCommonConstant.VOID);
entity.setDocumentSignature("");
}else if("1".equals(PROCESS_STATUS)){
entity.setDocumentSignature("");
}
//todo 处理意见和签名
reportDocumentMainMapper.updateById(entity);
JSONObject ret = new JSONObject();
return CommonResult.success(ret);
}
private void assembleSignature(String currentActivityId, ReportDocumentMainDO entity){
String sign = entity.getDocumentSignature();
JSONObject signObj = new JSONObject();
if(!ObjectUtils.isEmpty( sign))
signObj = JSONObject.parseObject(sign);
if(!signObj.containsKey(currentActivityId))
return;
JSONObject obj = new JSONObject();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long userId = loginUser.getId();
//当前登录用户昵称
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
ConfigUserSignatureDO configUserSignatureDO = configUserSignatureService.getByUserId(userId);
if(configUserSignatureDO != null)
obj.put("fileId", configUserSignatureDO.getFileId());
obj.put("userId", userId);
obj.put("userName", nickName);
signObj.put(currentActivityId, obj);
entity.setDocumentSignature(signObj.toJSONString());
}
}

View File

@@ -106,7 +106,7 @@ public class DataTemplateController implements BusinessControllerMarker {
@GetMapping("/get")
@Operation(summary = "获得表单设计器模板")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('qms:data-template:query')")
// @PreAuthorize("@ss.hasPermission('qms:data-template:query')")
public CommonResult<DataTemplateRespVO> getDataTemplate(@RequestParam("id") Long id) {
DataTemplateDO dataTemplate = dataTemplateService.getDataTemplate(id);
return success(BeanUtils.toBean(dataTemplate, DataTemplateRespVO.class));

View File

@@ -35,6 +35,13 @@
FROM T_BSN_ASY_RPT_DAT d
inner join T_BSN_BSE_SMP s on d.BSN_BSE_SMP_ID = s.id
<where>
<if test="param.idList != null and param.idList.size > 0">
and d.id in (
<foreach item="item" collection="param.idList" separator=",">
#{item}
</foreach>
)
</if>
<if test="param.configReportTypeId != null and param.configReportTypeId != ''">
and d.CFG_RPT_TP_ID = #{param.configReportTypeId}
and NOT EXISTS (
@@ -43,6 +50,7 @@
LEFT JOIN T_RPT_DOC_MAIN m on rd.MAIN_ID = m.ID
WHERE rd.SRC_ID = d.id
and m.RPT_DOC_TP = #{param.configReportTypeId}
and m.FLW_STS in ('not_start','in_progress','completed','rejected')
);
</if>
<if test="param.businessSampleEntrustRegistrationIdList != null and param.businessSampleEntrustRegistrationIdList.size > 0">

View File

@@ -63,7 +63,7 @@
<where>
and NOT EXISTS (
select 1 from T_RPT_DOC_MAIN dm left join T_RPT_DOC_MAIN_CORR dc on dm.id = dc.MAIN_ID
where dc.CORR_ID = m.id and dm.deleted = 0
where dc.CORR_ID = m.id and dm.FLW_STS in ('not_start','in_progress','completed','rejected') and dm.deleted = 0
)
<if test="param.entrustType != null and param.entrustType != ''">
and m.ENTT_TP = #{param.entrustType}

View File

@@ -0,0 +1,12 @@
<?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="com.zt.plat.module.qms.business.config.dal.mapper.ConfigUserSignatureMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>