feat : epost 개발중. 파싱후 업데이트 로직 정리중
parent
cad8887fa7
commit
c89fcc8f5a
@ -0,0 +1,56 @@
|
||||
package com.worker.domain.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Table(
|
||||
name = "epost_deliv_result",
|
||||
indexes = {
|
||||
@Index(name = "EPOST_DELIV_RESULT_IDX1", columnList = "CON_KEY, REGINO, DELIVYMD, DELIVHHMI")
|
||||
}
|
||||
)
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class EpostDelivResult {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "SEQ_KEY", nullable = false, updatable = false)
|
||||
private Long seqKey;
|
||||
|
||||
@Column(name = "CON_KEY", nullable = false, length = 30)
|
||||
private String conKey;
|
||||
|
||||
@Column(name = "REGINO", nullable = false, length = 13)
|
||||
private String regino;
|
||||
|
||||
@Column(name = "DELIVYMD", nullable = false, length = 8)
|
||||
private String delivYmd;
|
||||
|
||||
@Column(name = "DELIVHHMI", nullable = false, length = 4)
|
||||
private String delivHhmi;
|
||||
|
||||
@Column(name = "OUTSIDUSERID", length = 13)
|
||||
private String outsidUserId;
|
||||
|
||||
@Column(name = "DELIVRSLTCD", length = 2)
|
||||
private String delivRsltCd;
|
||||
|
||||
@Column(name = "NONDELIVREASNCD", length = 2)
|
||||
private String nonDelivReasnCd;
|
||||
|
||||
@Column(name = "NONDELIVREASNCDNM", length = 60)
|
||||
private String nonDelivReasnCdNm;
|
||||
|
||||
@Column(name = "SUBRECPRSNNM", length = 70)
|
||||
private String subRecPrsnNm;
|
||||
|
||||
@Column(name = "RELRECPRSNCD", length = 2)
|
||||
private String relRecPrsnCd;
|
||||
|
||||
@Column(name = "RELRECPRSNCDNM", length = 100)
|
||||
private String relRecPrsnCdNm;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.worker.domain.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Table(name = "epost_make_result")
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@IdClass(EpostMakeResultId.class)
|
||||
public class EpostMakeResult {
|
||||
|
||||
@Id
|
||||
@Column(name = "CON_KEY", nullable = false, length = 30)
|
||||
private String conKey;
|
||||
|
||||
@Id
|
||||
@Column(name = "RGST_NMBR", nullable = false, length = 13)
|
||||
private String rgstNmbr;
|
||||
|
||||
@Column(name = "RELETCDATA", length = 200)
|
||||
private String reletcData;
|
||||
|
||||
@Column(name = "DATA_CD", length = 2)
|
||||
private String dataCd;
|
||||
|
||||
@Column(name = "MAIL_CNT", length = 5)
|
||||
private String mailCnt;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.worker.domain.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class EpostMakeResultId implements Serializable {
|
||||
private String conKey;
|
||||
private String rgstNmbr;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.worker.domain.repo.cp;
|
||||
|
||||
import com.worker.domain.entity.EpostDelivResult;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface CpEpostDelivResultRepository extends JpaRepository<EpostDelivResult, Long> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.worker.domain.repo.cp;
|
||||
|
||||
import com.worker.domain.entity.EpostRceptResult;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface CpEpostRceptResultRepository extends JpaRepository<EpostRceptResult, Long> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.worker.domain.repo.ep;
|
||||
|
||||
import com.worker.domain.entity.EpostDelivResult;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface EpEpostDelivResultRepository extends JpaRepository<EpostDelivResult, Long> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.worker.domain.repo.ep;
|
||||
|
||||
import com.worker.domain.entity.EpostRceptResult;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface EpEpostRceptResultRepository extends JpaRepository<EpostRceptResult, Long> {
|
||||
}
|
||||
@ -1,19 +1,81 @@
|
||||
package com.worker.scheduler.epost.repository;
|
||||
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import com.worker.scheduler.epost.dto.EPostDto;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.worker.domain.entity.QEpostDelivResult.epostDelivResult;
|
||||
import static com.worker.domain.entity.QEpostRceptResult.epostRceptResult;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class EPostQueryDslRepository {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
|
||||
public List<EPostDto.Deliv> findDelivResult(List<EPostDto.Deliv> dtos) {
|
||||
|
||||
List<String> conKeys = dtos.stream()
|
||||
.map(EPostDto.Deliv::getConKey)
|
||||
.toList();
|
||||
|
||||
List<String> reginos = dtos.stream()
|
||||
.map(EPostDto.Deliv::getRegiNo)
|
||||
.toList();
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
Projections.fields(
|
||||
EPostDto.Deliv.class,
|
||||
epostDelivResult.conKey
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
.from(epostDelivResult)
|
||||
.where(
|
||||
epostDelivResult.conKey.in(conKeys),
|
||||
epostDelivResult.regino.in(reginos)
|
||||
)
|
||||
.fetch();
|
||||
}
|
||||
|
||||
public List<EPostDto.Prt> findMakeResult(List<EPostDto.Prt> dtos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<EPostDto.Deliv> findRceptResult(List<EPostDto.Deliv> dtos) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void updateAAATable() {
|
||||
public void updateDelivResult(EPostDto.Deliv dto) {
|
||||
queryFactory
|
||||
.update(epostDelivResult)
|
||||
.set(epostDelivResult.delivRsltCd, dto.getResultCd())
|
||||
.where(
|
||||
epostDelivResult.conKey.eq(dto.getConKey())
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
public void updateMakeResult(List<EPostDto.Deliv> dtos) {
|
||||
|
||||
}
|
||||
|
||||
public void updateRceptResult(List<EPostDto.Deliv> dtos) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue