- esn_tag_binding: ESL 태그 ↔ 선반위치 ↔ 상품 매핑 테이블 - esn_update_queue: POS 가격변경 → 태그 RF 전파 추적 큐 - TagBindingController/Service/Mapper: 태그 바인딩 CRUD + 언바인딩 - UpdateQueueController/Service/Mapper: Gateway 폴링(/poll), 태그 ACK(/confirm), 실패재시도 - PosCvtService.process(): 가격 처리 시 바인딩된 e-paper 태그에 자동 큐 생성 - 프론트: TagBindingList.tsx (배터리/신호강도), UpdateQueueList.tsx (5초 자동갱신) - 사이드바: 태그 바인딩 / 업데이트 큐 메뉴 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package com.zioinfo.esn.service;
|
|
|
|
import com.zioinfo.esn.domain.PosCvtVo;
|
|
import com.zioinfo.esn.mapper.PosCvtMapper;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.util.List;
|
|
|
|
@Slf4j
|
|
@Service
|
|
@RequiredArgsConstructor
|
|
public class PosCvtService {
|
|
private final PosCvtMapper mapper;
|
|
private final TagBindingService tagBindingService;
|
|
|
|
public List<PosCvtVo> list(String tenantCode, Long storeId, String status, String keyword) {
|
|
return mapper.findAll(tenantCode, storeId, status, keyword);
|
|
}
|
|
|
|
public PosCvtVo get(Long id) { return mapper.findById(id); }
|
|
|
|
/**
|
|
* POS 가격변경 처리 → 바인딩된 e-paper 태그에 업데이트 큐 자동 생성
|
|
*/
|
|
@Transactional
|
|
public int process(Long id) {
|
|
PosCvtVo pos = mapper.findById(id);
|
|
if (pos == null) return 0;
|
|
|
|
mapper.updateStatus(id, "PROCESSED", null);
|
|
|
|
// 이 상품에 바인딩된 e-paper 태그들에 가격 업데이트 큐 생성
|
|
int queued = tagBindingService.enqueueByProductCode(
|
|
pos.getTenantCode(), pos.getStoreId(),
|
|
pos.getProductCode(), pos.getPrice(), pos.getSalePrice(), id);
|
|
|
|
log.info("POS 처리 완료: posCvtId={}, product={}, 큐생성={}개",
|
|
id, pos.getProductCode(), queued);
|
|
return queued;
|
|
}
|
|
|
|
public void markError(Long id, String errorMessage) {
|
|
mapper.updateStatus(id, "ERROR", errorMessage);
|
|
}
|
|
|
|
public void ignore(Long id) {
|
|
mapper.updateStatus(id, "IGNORED", null);
|
|
}
|
|
}
|