|
@@ -369,7 +369,6 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//填写回库表单
|
|
//填写回库表单
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -433,6 +432,49 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @LogRecord(type = MUSEUMS_SPECIMEN_TYPE, subType = MUSEUMS_SPECIMEN_REJECT_RETURN_SUB_TYPE,
|
|
|
|
+ bizNo = "{{#existingSpecimen.id}}", // 使用更新的出库单 ID
|
|
|
|
+ success = MUSEUMS_SPECIMEN_UPDATE_REJECT_RETURN_SUCCESS , extra = "{{#existingSpecimen.infoId}}") // 定义更新成功的日志消息
|
|
|
|
+ public void rejectSpecimenOutbound(SpecimenOutboundRejectReturnReqVO updateReqVO){
|
|
|
|
+ // 校验存在
|
|
|
|
+ validateSpecimenOutboundExists(updateReqVO.getId());
|
|
|
|
+ // 获取当前标本的状态
|
|
|
|
+ SpecimenOutboundDO existingSpecimen = specimenOutboundMapper.selectById(updateReqVO.getId());
|
|
|
|
+ Long returnConfirm = existingSpecimen.getReturnConfirm();
|
|
|
|
+ // 判断状态是否为已出库(3)
|
|
|
|
+ if (existingSpecimen.getStatus() != 3) {
|
|
|
|
+ throw exception(ONLY_OUTBOUND_SPECIMEN_CAN_REJECT_RETURNED);
|
|
|
|
+ }
|
|
|
|
+ //删除第一回库确认员
|
|
|
|
+ existingSpecimen.setReturnConfirm(0L).setReturnRejectReason(updateReqVO.getReturnRejectReason());
|
|
|
|
+
|
|
|
|
+ System.out.println(existingSpecimen.getReturnConfirm()+"=============================");
|
|
|
|
+ // 更新数据库
|
|
|
|
+ specimenOutboundMapper.updateById(existingSpecimen);
|
|
|
|
+
|
|
|
|
+ // 记录日志上下文
|
|
|
|
+ LogRecordContext.putVariable("existingSpecimen", existingSpecimen);
|
|
|
|
+ LogRecordContext.putVariable("returnRejectReason", updateReqVO.getReturnRejectReason());
|
|
|
|
+
|
|
|
|
+ //发送站内信
|
|
|
|
+ String templateCode = "specimen_return_request_rejected";
|
|
|
|
+ Map<String, Object> templateParams = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ // 定义格式化模板
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+
|
|
|
|
+ // 转换 LocalDateTime 为字符串
|
|
|
|
+ String formattedDate = existingSpecimen.getUpdateTime().format(formatter);
|
|
|
|
+ templateParams.put("updateTime",formattedDate);
|
|
|
|
+ templateParams.put("returnRejectReason",updateReqVO.getReturnRejectReason());
|
|
|
|
+ templateParams.put("operator",getLoginUserNickname());
|
|
|
|
+
|
|
|
|
+ notifySendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO()
|
|
|
|
+ .setUserId(returnConfirm).setTemplateCode(templateCode).setTemplateParams(templateParams));
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void deleteSpecimenOutbound(Long id) {
|
|
public void deleteSpecimenOutbound(Long id) {
|
|
// 校验存在
|
|
// 校验存在
|