|
@@ -73,6 +73,28 @@ public class SealServiceImpl implements SealService {
|
|
|
return ResponseDTO.ok(seal);
|
|
return ResponseDTO.ok(seal);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public ResponseDTO<SealStatusVO> getStatus(SealStatusQueryDTO queryDTO) {
|
|
|
|
|
+ if (queryDTO.getId() == null && !StringUtils.hasText(queryDTO.getSealAlias())) {
|
|
|
|
|
+ return ResponseDTO.error(ResponseDTO.ERROR_CODE, "请至少提供印章ID(id)或印章别名(sealAlias)之一");
|
|
|
|
|
+ }
|
|
|
|
|
+ LambdaQueryWrapper<Seal> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ wrapper.eq(queryDTO.getId() != null, Seal::getId, queryDTO.getId())
|
|
|
|
|
+ .eq(StringUtils.hasText(queryDTO.getSealAlias()),
|
|
|
|
|
+ Seal::getSealAlias, queryDTO.getSealAlias());
|
|
|
|
|
+ Seal seal = sealMapper.selectOne(wrapper);
|
|
|
|
|
+ if (seal == null) {
|
|
|
|
|
+ return ResponseDTO.error(ResponseDTO.ERROR_CODE, "印章不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ SealStatusEnum status = SealStatusEnum.of(seal.getSealStatus());
|
|
|
|
|
+ SealStatusVO vo = new SealStatusVO();
|
|
|
|
|
+ vo.setSealId(seal.getId());
|
|
|
|
|
+ vo.setSealAlias(seal.getSealAlias());
|
|
|
|
|
+ vo.setSealStatus(seal.getSealStatus());
|
|
|
|
|
+ vo.setStatusDesc(status != null ? status.getDesc() : "未知");
|
|
|
|
|
+ return ResponseDTO.ok(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ResponseDTO<Long> createSeal(SealCreateDTO createDTO) {
|
|
public ResponseDTO<Long> createSeal(SealCreateDTO createDTO) {
|