랜드 소유권 변경 처리
This commit is contained in:
@@ -55,12 +55,24 @@ public class LandController {
|
|||||||
|
|
||||||
return ResponseEntity.ok().body(landService.postLandAuction(landRequest));
|
return ResponseEntity.ok().body(landService.postLandAuction(landRequest));
|
||||||
}
|
}
|
||||||
|
@PostMapping("/change")
|
||||||
|
public ResponseEntity<LandResponse> postLandOwnerChanges(
|
||||||
|
@RequestBody LandRequest landRequest){
|
||||||
|
|
||||||
|
return ResponseEntity.ok().body(landService.postLandOwnerChanges(landRequest));
|
||||||
|
}
|
||||||
@PutMapping("/auction/{id}")
|
@PutMapping("/auction/{id}")
|
||||||
public ResponseEntity<LandResponse> updateLandAuction(
|
public ResponseEntity<LandResponse> updateLandAuction(
|
||||||
@PathVariable("id")Long id, @RequestBody LandRequest landRequest){
|
@PathVariable("id")Long id, @RequestBody LandRequest landRequest){
|
||||||
|
|
||||||
return ResponseEntity.ok().body(landService.updateLandAuction(id, landRequest));
|
return ResponseEntity.ok().body(landService.updateLandAuction(id, landRequest));
|
||||||
}
|
}
|
||||||
|
@PutMapping("/change/{id}")
|
||||||
|
public ResponseEntity<LandResponse> updateLandOwnerChanges(
|
||||||
|
@PathVariable("id")Long id, @RequestBody LandRequest landRequest){
|
||||||
|
|
||||||
|
return ResponseEntity.ok().body(landService.updateLandOwnerChanges(id, landRequest));
|
||||||
|
}
|
||||||
@DeleteMapping("/auction/delete")
|
@DeleteMapping("/auction/delete")
|
||||||
public ResponseEntity<LandResponse> deleteLandAuction(
|
public ResponseEntity<LandResponse> deleteLandAuction(
|
||||||
@RequestBody LandRequest landRequest){
|
@RequestBody LandRequest landRequest){
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.caliverse.admin.domain.dao.admin;
|
|||||||
|
|
||||||
import com.caliverse.admin.domain.entity.Event;
|
import com.caliverse.admin.domain.entity.Event;
|
||||||
import com.caliverse.admin.domain.entity.LandAuction;
|
import com.caliverse.admin.domain.entity.LandAuction;
|
||||||
|
import com.caliverse.admin.domain.entity.LandOwnerChange;
|
||||||
import com.caliverse.admin.domain.entity.Message;
|
import com.caliverse.admin.domain.entity.Message;
|
||||||
import com.caliverse.admin.domain.request.LandRequest;
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ public interface LandMapper {
|
|||||||
int getAllCnt(Map map);
|
int getAllCnt(Map map);
|
||||||
int getTotal();
|
int getTotal();
|
||||||
LandAuction getLandAuctionDetail(Long id);
|
LandAuction getLandAuctionDetail(Long id);
|
||||||
|
LandOwnerChange getLandOwnerChangeDetail(Long id);
|
||||||
|
|
||||||
List<Message> getMessage(Long id);
|
List<Message> getMessage(Long id);
|
||||||
|
|
||||||
@@ -22,9 +24,11 @@ public interface LandMapper {
|
|||||||
int getPossibleLand(Integer landId);
|
int getPossibleLand(Integer landId);
|
||||||
|
|
||||||
int postLandAuction(LandRequest landRequest);
|
int postLandAuction(LandRequest landRequest);
|
||||||
|
int postLandOwnerChange(LandRequest landRequest);
|
||||||
|
|
||||||
void insertMessage(Map map);
|
void insertMessage(Map map);
|
||||||
int updateLandAuction(LandRequest landRequest);
|
int updateLandAuction(LandRequest landRequest);
|
||||||
|
int updateLandOwnerChange(LandRequest landRequest);
|
||||||
|
|
||||||
int deleteMessage(Map map);
|
int deleteMessage(Map map);
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.caliverse.admin.domain.entity;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public enum ECurrencyType {
|
|
||||||
|
|
||||||
NONE(0, "None"),
|
|
||||||
GOLD(1, "Gold"),
|
|
||||||
SAPPHIRE(2, "Sapphire"),
|
|
||||||
CALIUM(3, "Calium"),
|
|
||||||
BEAM(4, "Beam"),
|
|
||||||
RUBY(5, "Ruby");
|
|
||||||
|
|
||||||
private final int value;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
ECurrencyType(int value, String name) {
|
|
||||||
this.value = value;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getValueByName(String name) {
|
|
||||||
return Arrays.stream(values())
|
|
||||||
.filter(type -> type.name.equalsIgnoreCase(name))
|
|
||||||
.findFirst()
|
|
||||||
.map(ECurrencyType::getValue)
|
|
||||||
.orElse(NONE.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -44,7 +44,9 @@ public enum HISTORYTYPE {
|
|||||||
LAND_AUCTION_DELETE("랜드경매 삭제"),
|
LAND_AUCTION_DELETE("랜드경매 삭제"),
|
||||||
BATTLE_EVENT_ADD("전투시스템 이벤트 등록"),
|
BATTLE_EVENT_ADD("전투시스템 이벤트 등록"),
|
||||||
BATTLE_EVENT_UPDATE("전투시스템 이벤트 수정"),
|
BATTLE_EVENT_UPDATE("전투시스템 이벤트 수정"),
|
||||||
BATTLE_EVENT_DELETE("전투시스템 이벤트 삭제")
|
BATTLE_EVENT_DELETE("전투시스템 이벤트 삭제"),
|
||||||
|
LAND_OWNER_CHANGE_ADD("랜드 소유권 변경 등록"),
|
||||||
|
LAND_OWNER_CHANGE_UPDATE("랜드 소유권 변경 수정")
|
||||||
;
|
;
|
||||||
private String historyType;
|
private String historyType;
|
||||||
HISTORYTYPE(String type) {
|
HISTORYTYPE(String type) {
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ public class LandInfo {
|
|||||||
@JsonProperty("land_type")
|
@JsonProperty("land_type")
|
||||||
private String landType;
|
private String landType;
|
||||||
private String category;
|
private String category;
|
||||||
|
@JsonProperty("building_id")
|
||||||
|
private Integer buildingId;
|
||||||
|
@JsonProperty("building_name")
|
||||||
|
private String buildingName;
|
||||||
@JsonProperty("owner_user_guid")
|
@JsonProperty("owner_user_guid")
|
||||||
private String ownerUserGuid;
|
private String ownerUserGuid;
|
||||||
@JsonProperty("owner_user_nickname")
|
@JsonProperty("owner_user_nickname")
|
||||||
@@ -36,12 +40,22 @@ public class LandInfo {
|
|||||||
@JsonProperty("owner_user_create_date")
|
@JsonProperty("owner_user_create_date")
|
||||||
// private LocalDateTime ownerUserCreateDate;
|
// private LocalDateTime ownerUserCreateDate;
|
||||||
private String ownerUserCreateDate;
|
private String ownerUserCreateDate;
|
||||||
@JsonProperty("owner_user_price")
|
@JsonProperty("owner_price")
|
||||||
private String ownerUserPrice;
|
private String ownerPrice;
|
||||||
@JsonProperty("non_auction")
|
@JsonProperty("non_auction")
|
||||||
private boolean nonAuction;
|
private boolean nonAuction;
|
||||||
private Integer socket;
|
private Integer socket;
|
||||||
private Integer editor;
|
private String editor;
|
||||||
private String status;
|
private String status;
|
||||||
private String isUpdate;
|
private String isUpdate;
|
||||||
|
private boolean isOwned;
|
||||||
|
|
||||||
|
public enum LAND_STATUS {
|
||||||
|
NONE,
|
||||||
|
AUCTION_RUNNING,
|
||||||
|
AUCTION_WAIT,
|
||||||
|
AUCTION_END,
|
||||||
|
OWNED,
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.caliverse.admin.domain.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class LandOwnerChange {
|
||||||
|
private Long id;
|
||||||
|
@JsonProperty("row_num")
|
||||||
|
private Integer rowNum;
|
||||||
|
@JsonProperty("land_id")
|
||||||
|
private Integer landId;
|
||||||
|
@JsonProperty("land_name")
|
||||||
|
private String landName;
|
||||||
|
@JsonProperty("user_guid")
|
||||||
|
private String userGuid;
|
||||||
|
@JsonProperty("reservation_dt")
|
||||||
|
private LocalDateTime reservationDt;
|
||||||
|
@JsonProperty("is_reserve")
|
||||||
|
private LocalDateTime isReserve;
|
||||||
|
private CHANGE_STATUS status;
|
||||||
|
|
||||||
|
private boolean deleted;
|
||||||
|
|
||||||
|
@JsonProperty("create_by")
|
||||||
|
private String createBy;
|
||||||
|
@JsonProperty("create_dt")
|
||||||
|
private LocalDateTime createDt;
|
||||||
|
@JsonProperty("update_by")
|
||||||
|
private String updateBy;
|
||||||
|
@JsonProperty("update_dt")
|
||||||
|
private LocalDateTime updateDt;
|
||||||
|
|
||||||
|
public enum CHANGE_STATUS {
|
||||||
|
WAIT,
|
||||||
|
FINISH,
|
||||||
|
RUNNING,
|
||||||
|
FAIL
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,6 +50,21 @@ public class LandRequest {
|
|||||||
@JsonProperty("message_list")
|
@JsonProperty("message_list")
|
||||||
private List<Message> massageList;
|
private List<Message> massageList;
|
||||||
|
|
||||||
|
//소유권 변경
|
||||||
|
@JsonProperty("user_guid")
|
||||||
|
private String userGuid;
|
||||||
|
@JsonProperty("user_name")
|
||||||
|
private String userName;
|
||||||
|
@JsonProperty("is_reserve")
|
||||||
|
private boolean isReserve;
|
||||||
|
@JsonProperty("reservation_dt")
|
||||||
|
private LocalDateTime reservationDt;
|
||||||
|
|
||||||
|
@JsonProperty("building_id")
|
||||||
|
private Integer buildingId;
|
||||||
|
@JsonProperty("building_name")
|
||||||
|
private String buildingName;
|
||||||
|
|
||||||
@JsonProperty("create_by")
|
@JsonProperty("create_by")
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
@JsonProperty("create_dt")
|
@JsonProperty("create_dt")
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.caliverse.admin.domain.request.LandRequest;
|
|||||||
import com.caliverse.admin.domain.response.LandResponse;
|
import com.caliverse.admin.domain.response.LandResponse;
|
||||||
import com.caliverse.admin.dynamodb.service.DynamodbLandAuctionService;
|
import com.caliverse.admin.dynamodb.service.DynamodbLandAuctionService;
|
||||||
import com.caliverse.admin.dynamodb.service.DynamodbLandService;
|
import com.caliverse.admin.dynamodb.service.DynamodbLandService;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamodbService;
|
||||||
import com.caliverse.admin.dynamodb.service.DynamodbUserService;
|
import com.caliverse.admin.dynamodb.service.DynamodbUserService;
|
||||||
import com.caliverse.admin.global.common.code.CommonCode;
|
import com.caliverse.admin.global.common.code.CommonCode;
|
||||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||||
@@ -19,7 +20,9 @@ import com.caliverse.admin.global.common.code.SuccessCode;
|
|||||||
import com.caliverse.admin.global.common.constants.CommonConstants;
|
import com.caliverse.admin.global.common.constants.CommonConstants;
|
||||||
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
||||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
|
import com.caliverse.admin.global.common.utils.DateUtils;
|
||||||
import com.caliverse.admin.history.service.MysqlHistoryLogService;
|
import com.caliverse.admin.history.service.MysqlHistoryLogService;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -34,6 +37,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertIsoByDatetime;
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertIsoByDatetime;
|
||||||
|
import static com.caliverse.admin.global.common.utils.DateUtils.stringToDateTime;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -50,6 +54,7 @@ public class LandService {
|
|||||||
private final HistoryService historyService;
|
private final HistoryService historyService;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
private final MysqlHistoryLogService mysqlHistoryLogService;
|
private final MysqlHistoryLogService mysqlHistoryLogService;
|
||||||
|
private final DynamodbService dynamodbService;
|
||||||
|
|
||||||
public LandResponse getLandInfo(@RequestParam Map<String, String> requestParam){
|
public LandResponse getLandInfo(@RequestParam Map<String, String> requestParam){
|
||||||
String searchType = requestParam.getOrDefault("land_type", "ID");
|
String searchType = requestParam.getOrDefault("land_type", "ID");
|
||||||
@@ -65,6 +70,7 @@ public class LandService {
|
|||||||
|
|
||||||
List<MetaLandData> landData = metaDataHandler.getMetaLandListData();
|
List<MetaLandData> landData = metaDataHandler.getMetaLandListData();
|
||||||
List<MetaBuildingData> buildingData = metaDataHandler.getMetaBuildingListData();
|
List<MetaBuildingData> buildingData = metaDataHandler.getMetaBuildingListData();
|
||||||
|
List<LandAuction> auctions = landMapper.getLandAuctionList(new HashMap());
|
||||||
|
|
||||||
List<LandInfo> list = landData.stream()
|
List<LandInfo> list = landData.stream()
|
||||||
//필터 전처리(map 처리속도를 최대한 빠르게하기 위해서 먼저 필터 처리할수 있는건 한다)
|
//필터 전처리(map 처리속도를 최대한 빠르게하기 위해서 먼저 필터 처리할수 있는건 한다)
|
||||||
@@ -87,7 +93,7 @@ public class LandService {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
})
|
})
|
||||||
.map(data -> buildLandInfo(data, buildingData))
|
.map(data -> buildLandInfo(data, buildingData, auctions))
|
||||||
.filter(info -> {
|
.filter(info -> {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
|
|
||||||
@@ -121,40 +127,92 @@ public class LandService {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private LandInfo buildLandInfo(MetaLandData data, List<MetaBuildingData> buildingData){
|
private LandInfo buildLandInfo(MetaLandData data, List<MetaBuildingData> buildingData, List<LandAuction> auctions){
|
||||||
int landId = data.getLandId();
|
|
||||||
LandAttrib land = dynamodbLandService.getLandInfo(landId);
|
|
||||||
String ownerGuid = land == null ? "" : land.getOwnerUserGuid();
|
|
||||||
String ownerName = data.getEditor().equals(CommonConstants.CALIVERSE_CODE) ? CommonConstants.CALIVERSE_NAME :
|
|
||||||
ownerGuid.isEmpty() ? "" : dynamodbUserService.getGuidByName(ownerGuid);
|
|
||||||
String ownerDate = ownerGuid.isEmpty() ? null : dynamodbLandService.getLandOwnerCreateDate(ownerGuid, landId); //랜드 소유 일자
|
|
||||||
int buildingSocket = buildingData.stream()
|
|
||||||
.filter(building -> building.getBuildingId().equals(data.getBuildingId()))
|
|
||||||
.findFirst().get()
|
|
||||||
.getInstanceSocket();
|
|
||||||
|
|
||||||
String parsedDate = null;
|
|
||||||
if (ownerDate != null && !ownerDate.isEmpty()) {
|
|
||||||
try {
|
try {
|
||||||
parsedDate = convertIsoByDatetime(ownerDate);
|
int landId = data.getLandId();
|
||||||
} catch (DateTimeParseException e) {
|
String editor = data.getEditor();
|
||||||
log.warn("owner_date parsing fail: " + ownerDate, e);
|
boolean nonAction = data.isNonAuction();
|
||||||
|
|
||||||
|
String ownerGuid = "";
|
||||||
|
String ownerName = "";
|
||||||
|
String ownerDate = "";
|
||||||
|
double ownerPrice = 0;
|
||||||
|
String category = "";
|
||||||
|
String status = "";
|
||||||
|
|
||||||
|
if(editor.equals(CommonConstants.USER)){
|
||||||
|
LandAttrib land = dynamodbLandService.getLandInfo(landId);
|
||||||
|
//랜드 존재
|
||||||
|
if(land != null){
|
||||||
|
ownerGuid = land.getOwnerUserGuid();
|
||||||
|
ownerName = dynamodbUserService.getGuidByName(ownerGuid);
|
||||||
|
|
||||||
|
int auctionNumber = dynamodbLandAuctionService.getLandAuctionNumber(landId);
|
||||||
|
// 경매
|
||||||
|
if(auctionNumber > 0){
|
||||||
|
LandAuction auction = auctions.stream()
|
||||||
|
.filter(row -> row.getLandId().equals(landId) && row.getAuctionSeq().equals(auctionNumber))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
if(auction == null){
|
||||||
|
log.error("getLandInfo.buildLandInfo auction info error landId: {}, auctionNumber: {}", landId, auctionNumber);
|
||||||
|
}
|
||||||
|
LandAuction.AUCTION_STATUS auctionStatus = auction.getStatus();
|
||||||
|
if(auctionStatus.equals(LandAuction.AUCTION_STATUS.FAIL) || auctionStatus.equals(LandAuction.AUCTION_STATUS.CANCEL)){
|
||||||
|
status = "";
|
||||||
|
}else{
|
||||||
|
status = auctionStatus.toString();
|
||||||
|
}
|
||||||
|
ownerPrice = auction.getClosePrice();
|
||||||
|
ownerDate = stringToDateTime(auction.getCloseEndDt());
|
||||||
|
}else{
|
||||||
|
String parsedDate = dynamodbLandService.getLandOwnerCreateDate(ownerGuid, landId);
|
||||||
|
ownerDate = convertIsoByDatetime(parsedDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
ownerName = CommonConstants.CALIVERSE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(editor.equals(CommonConstants.CALIVERSE_CODE)){
|
||||||
|
category = CommonConstants.LAND_PUBLIC;
|
||||||
|
}else{
|
||||||
|
if(nonAction){
|
||||||
|
category = CommonConstants.LAND_EVENT;
|
||||||
|
}else{
|
||||||
|
category = CommonConstants.LAND_AUCTION;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isOwned = editor.equals(CommonConstants.USER) && nonAction && ownerGuid.isEmpty();
|
||||||
|
|
||||||
|
MetaBuildingData buildingInfo = buildingData.stream()
|
||||||
|
.filter(building -> building.getBuildingId().equals(data.getBuildingId()))
|
||||||
|
.findFirst().get();
|
||||||
|
|
||||||
return LandInfo.builder()
|
return LandInfo.builder()
|
||||||
.id((long) landId)
|
.id((long) landId)
|
||||||
.landId(landId)
|
.landId(landId)
|
||||||
.landName(metaDataHandler.getTextStringData(data.getLandName()))
|
.landName(metaDataHandler.getTextStringData(data.getLandName()))
|
||||||
.landDesc(metaDataHandler.getTextStringData(data.getLandDesc()))
|
.landDesc(metaDataHandler.getTextStringData(data.getLandDesc()))
|
||||||
.nonAuction(data.isNonAuction())
|
.buildingId(data.getBuildingId())
|
||||||
|
.buildingName(metaDataHandler.getTextStringData(buildingInfo.getBuildingName()))
|
||||||
|
.nonAuction(nonAction)
|
||||||
|
.editor(editor)
|
||||||
|
.status(status)
|
||||||
|
.isOwned(isOwned)
|
||||||
|
.category(category)
|
||||||
.landSize(data.getLandSize())
|
.landSize(data.getLandSize())
|
||||||
.landType(data.getLandType())
|
.landType(data.getLandType())
|
||||||
.socket(buildingSocket)
|
.socket(buildingInfo.getInstanceSocket())
|
||||||
.ownerUserGuid(ownerGuid)
|
.ownerUserGuid(ownerGuid)
|
||||||
.ownerUserNickname(ownerName)
|
.ownerUserNickname(ownerName)
|
||||||
.ownerUserCreateDate(parsedDate)
|
.ownerUserCreateDate(ownerDate)
|
||||||
|
.ownerPrice(String.valueOf(ownerPrice))
|
||||||
.build();
|
.build();
|
||||||
|
}catch(Exception e){
|
||||||
|
log.error("buildLandInfo", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 랜드 메타데이터 정보 조회
|
// 랜드 메타데이터 정보 조회
|
||||||
@@ -301,17 +359,17 @@ public class LandService {
|
|||||||
map.put("id",String.valueOf(auction_id));
|
map.put("id",String.valueOf(auction_id));
|
||||||
|
|
||||||
//메시지 저장
|
//메시지 저장
|
||||||
if(landRequest.getMassageList()!= null && !landRequest.getMassageList().isEmpty()){
|
// if(landRequest.getMassageList()!= null && !landRequest.getMassageList().isEmpty()){
|
||||||
landRequest.getMassageList().forEach(
|
// landRequest.getMassageList().forEach(
|
||||||
item -> {
|
// item -> {
|
||||||
map.put("title",item.getTitle());
|
// map.put("title",item.getTitle());
|
||||||
map.put("content",item.getContent());
|
// map.put("content",item.getContent());
|
||||||
map.put("language",item.getLanguage());
|
// map.put("language",item.getLanguage());
|
||||||
landMapper.insertMessage(map);
|
// landMapper.insertMessage(map);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
log.info("AdminToolDB Message Save Complete");
|
// log.info("AdminToolDB Message Save Complete");
|
||||||
|
|
||||||
LandAuction auction_info = landMapper.getLandAuctionDetail(auction_id);
|
LandAuction auction_info = landMapper.getLandAuctionDetail(auction_id);
|
||||||
auction_info.setMessageList(landMapper.getMessage(auction_id));
|
auction_info.setMessageList(landMapper.getMessage(auction_id));
|
||||||
@@ -336,6 +394,61 @@ public class LandService {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(transactionManager = "transactionManager")
|
||||||
|
public LandResponse postLandOwnerChanges(LandRequest landRequest){
|
||||||
|
String guid = landRequest.getUserGuid();
|
||||||
|
String nickname = dynamodbUserService.getGuidByName(guid);
|
||||||
|
if(nickname.isEmpty() || !nickname.equals(landRequest.getUserName())){
|
||||||
|
return LandResponse.builder()
|
||||||
|
.status(CommonCode.ERROR.getHttpStatus())
|
||||||
|
.result(ErrorCode.GUID_CHECK.toString())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
landRequest.setCreateBy(CommonUtils.getAdmin().getId());
|
||||||
|
boolean is_reserve = landRequest.isReserve();
|
||||||
|
if(!is_reserve){
|
||||||
|
landRequest.setReservationDt(LocalDateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
int result = landMapper.postLandOwnerChange(landRequest);
|
||||||
|
try {
|
||||||
|
log.info("AdminToolDB LandOwnerChanges Save: {}", objectMapper.writeValueAsString(landRequest));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
long id = landRequest.getId();
|
||||||
|
|
||||||
|
HashMap<String,Object> map = new HashMap<>();
|
||||||
|
map.put("id",String.valueOf(id));
|
||||||
|
|
||||||
|
LandOwnerChange info = landMapper.getLandOwnerChangeDetail(id);
|
||||||
|
|
||||||
|
mysqlHistoryLogService.insertHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||||
|
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||||
|
info,
|
||||||
|
CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
|
if(!is_reserve){
|
||||||
|
dynamodbLandService.ChangesLandOwner(landRequest);
|
||||||
|
map.put("status", LandOwnerChange.CHANGE_STATUS.FINISH);
|
||||||
|
updateLandOwnedChangeStatus(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
return LandResponse.builder()
|
||||||
|
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||||
|
.result(CommonCode.SUCCESS.getResult())
|
||||||
|
.resultData(LandResponse.ResultData.builder()
|
||||||
|
.message(SuccessCode.SAVE.getMessage())
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(transactionManager = "transactionManager")
|
@Transactional(transactionManager = "transactionManager")
|
||||||
public LandResponse updateLandAuction(Long id, LandRequest landRequest) {
|
public LandResponse updateLandAuction(Long id, LandRequest landRequest) {
|
||||||
landRequest.setId(id);
|
landRequest.setId(id);
|
||||||
@@ -343,7 +456,7 @@ public class LandService {
|
|||||||
landRequest.setUpdateDt(LocalDateTime.now());
|
landRequest.setUpdateDt(LocalDateTime.now());
|
||||||
|
|
||||||
LandAuction before_info = landMapper.getLandAuctionDetail(id);
|
LandAuction before_info = landMapper.getLandAuctionDetail(id);
|
||||||
before_info.setMessageList(landMapper.getMessage(id));
|
// before_info.setMessageList(landMapper.getMessage(id));
|
||||||
|
|
||||||
if(!before_info.getStatus().equals(LandAuction.AUCTION_STATUS.WAIT) && !before_info.getStatus().equals(LandAuction.AUCTION_STATUS.RESV_START)){
|
if(!before_info.getStatus().equals(LandAuction.AUCTION_STATUS.WAIT) && !before_info.getStatus().equals(LandAuction.AUCTION_STATUS.RESV_START)){
|
||||||
return LandResponse.builder()
|
return LandResponse.builder()
|
||||||
@@ -359,19 +472,19 @@ public class LandService {
|
|||||||
map.put("id", String.valueOf(id));
|
map.put("id", String.valueOf(id));
|
||||||
|
|
||||||
// message 테이블 데이터 삭제 처리 by mail_id
|
// message 테이블 데이터 삭제 처리 by mail_id
|
||||||
landMapper.deleteMessage(map);
|
// landMapper.deleteMessage(map);
|
||||||
|
//
|
||||||
// 메시지 업데이트
|
// // 메시지 업데이트
|
||||||
if (landRequest.getMassageList() != null && !landRequest.getMassageList().isEmpty()) {
|
// if (landRequest.getMassageList() != null && !landRequest.getMassageList().isEmpty()) {
|
||||||
landRequest.getMassageList().forEach(item -> {
|
// landRequest.getMassageList().forEach(item -> {
|
||||||
map.put("title", item.getTitle());
|
// map.put("title", item.getTitle());
|
||||||
map.put("content", item.getContent());
|
// map.put("content", item.getContent());
|
||||||
map.put("language", item.getLanguage());
|
// map.put("language", item.getLanguage());
|
||||||
|
//
|
||||||
landMapper.insertMessage(map);
|
// landMapper.insertMessage(map);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
log.info("AdminToolDB Message Update Complete");
|
// log.info("AdminToolDB Message Update Complete");
|
||||||
|
|
||||||
LandAuction after_info = landMapper.getLandAuctionDetail(id);
|
LandAuction after_info = landMapper.getLandAuctionDetail(id);
|
||||||
after_info.setMessageList(landMapper.getMessage(id));
|
after_info.setMessageList(landMapper.getMessage(id));
|
||||||
@@ -388,17 +501,40 @@ public class LandService {
|
|||||||
|
|
||||||
dynamodbLandAuctionService.updateLandAuction(landRequest);
|
dynamodbLandAuctionService.updateLandAuction(landRequest);
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
try{
|
return LandResponse.builder()
|
||||||
JSONObject jsonObject = new JSONObject();
|
.resultData(LandResponse.ResultData.builder()
|
||||||
jsonObject.put("before_info",before_info.toString());
|
.build())
|
||||||
jsonObject.put("after_info",after_info.toString());
|
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||||
// jsonObject.put("dynamoDB_result",land_auction_registry_result);
|
.result(CommonCode.SUCCESS.getResult())
|
||||||
historyService.setLog(HISTORYTYPE.LAND_AUCTION_UPDATE, jsonObject);
|
.build();
|
||||||
}catch(Exception e){
|
|
||||||
log.error("history log Save Fail: {}", e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(transactionManager = "transactionManager")
|
||||||
|
public LandResponse updateLandOwnerChanges(Long id, LandRequest landRequest) {
|
||||||
|
landRequest.setId(id);
|
||||||
|
landRequest.setUpdateBy(CommonUtils.getAdmin().getId());
|
||||||
|
landRequest.setUpdateDt(LocalDateTime.now());
|
||||||
|
|
||||||
|
LandOwnerChange before_info = landMapper.getLandOwnerChangeDetail(id);
|
||||||
|
|
||||||
|
int result = landMapper.updateLandOwnerChange(landRequest);
|
||||||
|
log.info("AdminToolDB LandOwnerChanges Update Complete: {}", landRequest);
|
||||||
|
|
||||||
|
LandOwnerChange after_info = landMapper.getLandOwnerChangeDetail(id);
|
||||||
|
|
||||||
|
mysqlHistoryLogService.updateHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||||
|
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||||
|
before_info,
|
||||||
|
after_info,
|
||||||
|
CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
|
dynamodbLandService.ChangesLandOwner(landRequest);
|
||||||
|
|
||||||
return LandResponse.builder()
|
return LandResponse.builder()
|
||||||
.resultData(LandResponse.ResultData.builder()
|
.resultData(LandResponse.ResultData.builder()
|
||||||
.build())
|
.build())
|
||||||
@@ -488,4 +624,14 @@ public class LandService {
|
|||||||
log.error("updateLandAuction LandAuction Update Fail map: {}", map);
|
log.error("updateLandAuction LandAuction Update Fail map: {}", map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(transactionManager = "transactionManager")
|
||||||
|
public void updateLandOwnedChangeStatus(Map<String,Object> map){
|
||||||
|
try{
|
||||||
|
landMapper.updateStatusLandAuction(map);
|
||||||
|
log.info("updateLandOwnedChangeStatus LandOwned status changed: {}", map.get("status"));
|
||||||
|
}catch(Exception e){
|
||||||
|
log.error("updateLandOwnedChangeStatus LandOwned Update Fail map: {}", map);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ public class BuildingAttrib extends DynamoDBAttribBase{
|
|||||||
@JsonProperty("owner_user_guid")
|
@JsonProperty("owner_user_guid")
|
||||||
private String ownerUserGuid;
|
private String ownerUserGuid;
|
||||||
@JsonProperty("RentalCurrencyType")
|
@JsonProperty("RentalCurrencyType")
|
||||||
private String rentalCurrencyType;
|
private Integer rentalCurrencyType;
|
||||||
@JsonProperty("RentalCurrencyAmount")
|
@JsonProperty("RentalCurrencyAmount")
|
||||||
private Double rentalCurrencyAmount;
|
private Double rentalCurrencyAmount;
|
||||||
@JsonProperty("IsRentalOpen")
|
@JsonProperty("IsRentalOpen")
|
||||||
private String isRentalOpen;
|
private boolean isRentalOpen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamoDbBean
|
||||||
|
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||||
|
public class LandAuctionRecordAttrib {
|
||||||
|
@JsonProperty("land_meta_id")
|
||||||
|
private Integer landMetaId;
|
||||||
|
|
||||||
|
@JsonProperty("auction_number")
|
||||||
|
private Integer auctionNumber;
|
||||||
|
|
||||||
|
@DynamoDbAttribute("land_meta_id")
|
||||||
|
public Integer getLandMetaId() {
|
||||||
|
return landMetaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@DynamoDbAttribute("auction_number")
|
||||||
|
public Integer getAuctionNumber() {
|
||||||
|
return auctionNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.domain.doc;
|
||||||
|
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRecordAttrib;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamoDbBean
|
||||||
|
public class LandAuctionRecordDoc extends DynamoDBDocBase {
|
||||||
|
private LandAuctionRecordAttrib landAuctionRecordAttrib;
|
||||||
|
|
||||||
|
public String getAttribFieldName() {
|
||||||
|
return "LandAuctionActivityAttrib";
|
||||||
|
}
|
||||||
|
|
||||||
|
@DynamoDbAttribute("LandAuctionRecordAttrib")
|
||||||
|
public LandAuctionRecordAttrib getAttribValue() {
|
||||||
|
return landAuctionRecordAttrib;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttribValue(LandAuctionRecordAttrib value) {
|
||||||
|
this.landAuctionRecordAttrib = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.common.ValueEnum;
|
||||||
|
|
||||||
|
public enum ECurrencyType implements ValueEnum {
|
||||||
|
None(0),
|
||||||
|
Gold(1),
|
||||||
|
Sapphire(2),
|
||||||
|
Calium(4),
|
||||||
|
Beam(5),
|
||||||
|
Ruby(6),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
ECurrencyType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.common.ValueEnum;
|
||||||
|
|
||||||
|
public enum EOwnedType implements ValueEnum {
|
||||||
|
None(0),
|
||||||
|
Own(1),
|
||||||
|
Rent(2),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
EOwnedType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||||
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.BuildingAttrib;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.BuildingDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.entity.ECurrencyType;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.BuildingRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||||
|
import com.caliverse.admin.global.common.code.CommonCode;
|
||||||
|
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||||
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
|
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||||
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
|
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class BuildingRepositoryImpl extends BaseDynamoDBRepository<BuildingDoc> implements BuildingRepository {
|
||||||
|
public BuildingRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||||
|
super(operations, BuildingDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BuildingAttrib findBuildingAttrib(Integer buildingId) {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_BUILDING + buildingId)
|
||||||
|
.sortValue(DynamoDBConstants.EMPTY)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
BuildingDoc doc = findById(key);
|
||||||
|
if (doc == null) return null;
|
||||||
|
String attribJson = doc.getAttribValue();
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(attribJson, BuildingAttrib.class);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||||
|
ErrorCode.DYNAMODB_JSON_PARSE_ERROR.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertBuilding(LandRequest landRequest) {
|
||||||
|
try {
|
||||||
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
|
int building_id = landRequest.getBuildingId();
|
||||||
|
String guid = landRequest.getUserGuid();
|
||||||
|
|
||||||
|
String pk = DynamoDBConstants.PK_KEY_BUILDING + building_id;
|
||||||
|
|
||||||
|
BuildingAttrib attrib = new BuildingAttrib();
|
||||||
|
attrib.setAttribType(DynamoDBConstants.ATTRIB_BUILDING);
|
||||||
|
attrib.setBuildingName(landRequest.getBuildingName());
|
||||||
|
attrib.setBuildingMetaId(building_id);
|
||||||
|
attrib.setDescription("");
|
||||||
|
attrib.setOwnerUserGuid(guid);
|
||||||
|
attrib.setRentalCurrencyAmount(0.0);
|
||||||
|
attrib.setRentalCurrencyType(ECurrencyType.Calium.getValue());
|
||||||
|
attrib.setRentalOpen(true);
|
||||||
|
attrib.setBuildingGuid("");
|
||||||
|
|
||||||
|
BuildingDoc doc = new BuildingDoc();
|
||||||
|
doc.setPK(pk);
|
||||||
|
doc.setSK(DynamoDBConstants.EMPTY);
|
||||||
|
doc.setDocType(DynamoDBConstants.DOC_BUILDING);
|
||||||
|
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
|
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
|
||||||
|
save(doc);
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.insertHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||||
|
doc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("insert Error: {}", e.getMessage());
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBuilding(LandRequest landRequest) {
|
||||||
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
|
int land_id = landRequest.getLandId();
|
||||||
|
String guid = landRequest.getUserGuid();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_LAND + land_id)
|
||||||
|
.sortValue(DynamoDBConstants.EMPTY)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
BuildingDoc beforeDoc = findById(key);
|
||||||
|
|
||||||
|
if (beforeDoc != null) {
|
||||||
|
BuildingDoc afterDoc = deepCopy(beforeDoc, BuildingDoc.class);
|
||||||
|
|
||||||
|
BuildingAttrib attrib = new BuildingAttrib();
|
||||||
|
attrib.setDescription("");
|
||||||
|
attrib.setOwnerUserGuid(guid);
|
||||||
|
|
||||||
|
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
|
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||||
|
|
||||||
|
update(afterDoc);
|
||||||
|
|
||||||
|
log.info("BuildingDoc Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.updateHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||||
|
beforeDoc,
|
||||||
|
afterDoc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||||
|
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRecordDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.LandAuctionRecordRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||||
|
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class LandAuctionRecordRepositoryImpl extends BaseDynamoDBRepository<LandAuctionRecordDoc> implements LandAuctionRecordRepository {
|
||||||
|
public LandAuctionRecordRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||||
|
super(operations, LandAuctionRecordDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||||
import com.caliverse.admin.domain.request.LandRequest;
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.doc.LandDoc;
|
import com.caliverse.admin.dynamodb.domain.doc.LandDoc;
|
||||||
@@ -10,6 +11,7 @@ import com.caliverse.admin.global.common.code.CommonCode;
|
|||||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||||
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -19,6 +21,8 @@ import software.amazon.awssdk.enhanced.dynamodb.Key;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implements LandRepository {
|
public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implements LandRepository {
|
||||||
@@ -49,37 +53,38 @@ public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implemen
|
|||||||
try {
|
try {
|
||||||
LocalDateTime nowDate = LocalDateTime.now();
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
// String pk =
|
int land_id = landRequest.getLandId();
|
||||||
//
|
String guid = landRequest.getUserGuid();
|
||||||
// LandAttrib attrib = new LandAttrib();
|
|
||||||
// attrib.setLandName();
|
String pk = DynamoDBConstants.PK_KEY_LAND + land_id;
|
||||||
// attrib.setMailId(event.getId().intValue());
|
|
||||||
// attrib.setStartTime(convertUTCDate(event.getStartDt()));
|
LandAttrib attrib = new LandAttrib();
|
||||||
// attrib.setEndTime(convertUTCDate(event.getEndDt()));
|
attrib.setAttribType(DynamoDBConstants.ATTRIB_LAND);
|
||||||
// attrib.setSenderNickName(createSystemMessages(event.getMailList(), DynamodbUtil::getSenderByLanguage));
|
attrib.setLandName(landRequest.getLandName());
|
||||||
// attrib.setTitle(createSystemMessages(event.getMailList(), Message::getTitle));
|
attrib.setLandMetaId(land_id);
|
||||||
// attrib.setText(createSystemMessages(event.getMailList(), Message::getContent));
|
attrib.setDescription("");
|
||||||
// attrib.setItemList(createMailItems(event.getItemList()));
|
attrib.setOwnerUserGuid(guid);
|
||||||
//
|
|
||||||
// LandDoc doc = new LandDoc();
|
|
||||||
// doc.setPK(DynamoDBConstants.PK_KEY_LAND + landRequest.getLandId());
|
LandDoc doc = new LandDoc();
|
||||||
// doc.setSK(String.valueOf(event.getId()));
|
doc.setPK(pk);
|
||||||
// doc.setDocType(DynamoDBConstants.DOC_SYSTEMMAIL);
|
doc.setSK(DynamoDBConstants.EMPTY);
|
||||||
// doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
doc.setDocType(DynamoDBConstants.DOC_LAND);
|
||||||
// doc.setCreatedDateTime(convertUTCDate(nowDate));
|
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
// doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||||
// doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||||
// doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
//
|
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
// save(doc);
|
|
||||||
//
|
save(doc);
|
||||||
// dynamodbHistoryLogService.insertHistoryLog(
|
|
||||||
// HISTORYTYPE.EVENT_ADD,
|
dynamodbHistoryLogService.insertHistoryLog(
|
||||||
// HISTORYTYPE.EVENT_ADD.name(),
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||||
// doc,
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||||
// CommonUtils.getAdmin().getEmail(),
|
doc,
|
||||||
// CommonUtils.getClientIp()
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
// );
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("insert Error: {}", e.getMessage());
|
log.error("insert Error: {}", e.getMessage());
|
||||||
@@ -89,6 +94,44 @@ public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implemen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLand(LandRequest landRequest) {
|
public void updateLand(LandRequest landRequest) {
|
||||||
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
|
int land_id = landRequest.getLandId();
|
||||||
|
String guid = landRequest.getUserGuid();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_LAND + land_id)
|
||||||
|
.sortValue(DynamoDBConstants.EMPTY)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
LandDoc beforeDoc = findById(key);
|
||||||
|
|
||||||
|
if (beforeDoc != null) {
|
||||||
|
LandDoc afterDoc = deepCopy(beforeDoc, LandDoc.class);
|
||||||
|
|
||||||
|
LandAttrib attrib = new LandAttrib();
|
||||||
|
attrib.setDescription("");
|
||||||
|
attrib.setOwnerUserGuid(guid);
|
||||||
|
|
||||||
|
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
|
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||||
|
|
||||||
|
update(afterDoc);
|
||||||
|
|
||||||
|
log.info("LandDoc Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.updateHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||||
|
beforeDoc,
|
||||||
|
afterDoc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ public class NicknameRepositoryImpl extends BaseDynamoDBRepository<NicknameDoc>
|
|||||||
|
|
||||||
NicknameDoc doc = findById(key);
|
NicknameDoc doc = findById(key);
|
||||||
|
|
||||||
|
if (doc == null) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return objectMapper.readValue(doc.getAttribValue(), NicknameAttrib.class);
|
return objectMapper.readValue(doc.getAttribValue(), NicknameAttrib.class);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.OwnedBuildingAttrib;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.OwnedBuildingDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.entity.EOwnedType;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.OwnedBuildingRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||||
|
import com.caliverse.admin.global.common.code.CommonCode;
|
||||||
|
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||||
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
|
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||||
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
|
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class OwnedBuildingRepositoryImpl extends BaseDynamoDBRepository<OwnedBuildingDoc> implements OwnedBuildingRepository {
|
||||||
|
public OwnedBuildingRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||||
|
super(operations, OwnedBuildingDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OwnedBuildingDoc findOwnedBuilding(String guid, Integer buildingId) {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid)
|
||||||
|
.sortValue(String.valueOf(buildingId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return findById(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insert(String guid, Integer buildingId) {
|
||||||
|
try {
|
||||||
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
|
String pk = DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid;
|
||||||
|
|
||||||
|
OwnedBuildingAttrib attrib = new OwnedBuildingAttrib();
|
||||||
|
attrib.setAttribType(DynamoDBConstants.ATTRIB_OWNED_BUILDING);
|
||||||
|
attrib.setBuildingMetaId(buildingId);
|
||||||
|
attrib.setOwnedType(EOwnedType.Own.getValue());
|
||||||
|
|
||||||
|
OwnedBuildingDoc doc = new OwnedBuildingDoc();
|
||||||
|
doc.setPK(pk);
|
||||||
|
doc.setSK(String.valueOf(buildingId));
|
||||||
|
doc.setDocType(DynamoDBConstants.DOC_OWNED_BUILDING);
|
||||||
|
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
|
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
|
||||||
|
save(doc);
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.insertHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||||
|
doc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("insert Error: {}", e.getMessage());
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(String guid, Integer buildingId) {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid)
|
||||||
|
.sortValue(String.valueOf(buildingId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
OwnedBuildingDoc doc = findById(key);
|
||||||
|
|
||||||
|
delete(key);
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.deleteHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||||
|
doc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.OwnedLandAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.entity.EOwnedType;
|
||||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||||
import com.caliverse.admin.dynamodb.repository.OwnedLandRepository;
|
import com.caliverse.admin.dynamodb.repository.OwnedLandRepository;
|
||||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||||
|
import com.caliverse.admin.global.common.code.CommonCode;
|
||||||
|
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
|
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||||
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -13,6 +20,8 @@ import software.amazon.awssdk.enhanced.dynamodb.Key;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OwnedLandRepositoryImpl extends BaseDynamoDBRepository<OwnedLandDoc> implements OwnedLandRepository {
|
public class OwnedLandRepositoryImpl extends BaseDynamoDBRepository<OwnedLandDoc> implements OwnedLandRepository {
|
||||||
@@ -29,4 +38,62 @@ public class OwnedLandRepositoryImpl extends BaseDynamoDBRepository<OwnedLandDoc
|
|||||||
|
|
||||||
return findById(key);
|
return findById(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insert(String guid, Integer landId) {
|
||||||
|
try {
|
||||||
|
LocalDateTime nowDate = LocalDateTime.now();
|
||||||
|
|
||||||
|
String pk = DynamoDBConstants.PK_KEY_OWNED_LAND + guid;
|
||||||
|
|
||||||
|
OwnedLandAttrib attrib = new OwnedLandAttrib();
|
||||||
|
attrib.setAttribType(DynamoDBConstants.ATTRIB_OWNED_LAND);
|
||||||
|
attrib.setLandMetaId(landId);
|
||||||
|
attrib.setOwnedType(EOwnedType.Own.getValue());
|
||||||
|
|
||||||
|
OwnedLandDoc doc = new OwnedLandDoc();
|
||||||
|
doc.setPK(pk);
|
||||||
|
doc.setSK(String.valueOf(landId));
|
||||||
|
doc.setDocType(DynamoDBConstants.DOC_OWNED_LAND);
|
||||||
|
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||||
|
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||||
|
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||||
|
|
||||||
|
save(doc);
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.insertHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||||
|
doc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("insert Error: {}", e.getMessage());
|
||||||
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(String guid, Integer landId) {
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_LAND + guid)
|
||||||
|
.sortValue(String.valueOf(landId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
OwnedLandDoc doc = findById(key);
|
||||||
|
|
||||||
|
delete(key);
|
||||||
|
|
||||||
|
dynamodbHistoryLogService.deleteHistoryLog(
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||||
|
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||||
|
doc,
|
||||||
|
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||||
|
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class UserBaseRepositoryImpl extends BaseDynamoDBRepository<UserBaseDoc>
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
UserBaseDoc doc = findById(key);
|
UserBaseDoc doc = findById(key);
|
||||||
|
if(doc == null) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return objectMapper.readValue(doc.getAttribValue(), UserBaseAttrib.class);
|
return objectMapper.readValue(doc.getAttribValue(), UserBaseAttrib.class);
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.repository;
|
||||||
|
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRecordDoc;
|
||||||
|
|
||||||
|
public interface LandAuctionRecordRepository extends DynamoDBRepository<LandAuctionRecordDoc> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.caliverse.admin.dynamodb.repository;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.OwnedBuildingDoc;
|
||||||
|
|
||||||
|
public interface OwnedBuildingRepository extends DynamoDBRepository<OwnedBuildingDoc> {
|
||||||
|
OwnedBuildingDoc findOwnedBuilding(String guid, Integer buildingId);
|
||||||
|
void insert(String guid, Integer buildingId);
|
||||||
|
void delete(String guid, Integer buildingId);
|
||||||
|
}
|
||||||
@@ -4,4 +4,6 @@ import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
|||||||
|
|
||||||
public interface OwnedLandRepository extends DynamoDBRepository<OwnedLandDoc> {
|
public interface OwnedLandRepository extends DynamoDBRepository<OwnedLandDoc> {
|
||||||
OwnedLandDoc findOwnedLand(String guid, Integer landId);
|
OwnedLandDoc findOwnedLand(String guid, Integer landId);
|
||||||
|
void insert(String guid, Integer landId);
|
||||||
|
void delete(String guid, Integer landId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ package com.caliverse.admin.dynamodb.service;
|
|||||||
|
|
||||||
import com.caliverse.admin.domain.entity.LandAuction;
|
import com.caliverse.admin.domain.entity.LandAuction;
|
||||||
import com.caliverse.admin.domain.request.LandRequest;
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRecordDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.LandAuctionRecordRepository;
|
||||||
import com.caliverse.admin.global.common.annotation.DynamoDBTransaction;
|
import com.caliverse.admin.global.common.annotation.DynamoDBTransaction;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionHighestBidUserAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionHighestBidUserAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
||||||
import com.caliverse.admin.dynamodb.repository.LandAuctionActivityRepository;
|
import com.caliverse.admin.dynamodb.repository.LandAuctionActivityRepository;
|
||||||
import com.caliverse.admin.dynamodb.repository.LandAuctionHighestBidUserRepository;
|
import com.caliverse.admin.dynamodb.repository.LandAuctionHighestBidUserRepository;
|
||||||
import com.caliverse.admin.dynamodb.repository.LandAuctionRegistryRepository;
|
import com.caliverse.admin.dynamodb.repository.LandAuctionRegistryRepository;
|
||||||
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -19,6 +23,7 @@ public class DynamodbLandAuctionService {
|
|||||||
private final LandAuctionRegistryRepository registryRepository;
|
private final LandAuctionRegistryRepository registryRepository;
|
||||||
private final LandAuctionActivityRepository activityRepository;
|
private final LandAuctionActivityRepository activityRepository;
|
||||||
private final LandAuctionHighestBidUserRepository highestBidUserRepository;
|
private final LandAuctionHighestBidUserRepository highestBidUserRepository;
|
||||||
|
private final LandAuctionRecordRepository landAuctionRecordRepository;
|
||||||
|
|
||||||
@DynamoDBTransaction
|
@DynamoDBTransaction
|
||||||
public void insertLandAuctionRegistryWithActivity(LandRequest landRequest) {
|
public void insertLandAuctionRegistryWithActivity(LandRequest landRequest) {
|
||||||
@@ -49,4 +54,16 @@ public class DynamodbLandAuctionService {
|
|||||||
// return activityRepository.findAuctionNumber(landId);
|
// return activityRepository.findAuctionNumber(landId);
|
||||||
return registryRepository.findAuctionNumber(landId);
|
return registryRepository.findAuctionNumber(landId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getLandAuctionRecordNumber(Integer landId){
|
||||||
|
Key key = Key.builder()
|
||||||
|
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_RECORD)
|
||||||
|
.sortValue(String.valueOf(landId))
|
||||||
|
.build();
|
||||||
|
LandAuctionRecordDoc doc = landAuctionRecordRepository.findById(key);
|
||||||
|
|
||||||
|
if(doc == null) return 0;
|
||||||
|
|
||||||
|
return doc.getAttribValue().getAuctionNumber();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.caliverse.admin.dynamodb.service;
|
package com.caliverse.admin.dynamodb.service;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.BuildingAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.BuildingRepository;
|
||||||
import com.caliverse.admin.dynamodb.repository.LandRepository;
|
import com.caliverse.admin.dynamodb.repository.LandRepository;
|
||||||
|
import com.caliverse.admin.dynamodb.repository.OwnedBuildingRepository;
|
||||||
import com.caliverse.admin.dynamodb.repository.OwnedLandRepository;
|
import com.caliverse.admin.dynamodb.repository.OwnedLandRepository;
|
||||||
|
import com.caliverse.admin.global.common.annotation.DynamoDBTransaction;
|
||||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -15,6 +20,8 @@ import org.springframework.stereotype.Service;
|
|||||||
public class DynamodbLandService {
|
public class DynamodbLandService {
|
||||||
private final LandRepository landRepository;
|
private final LandRepository landRepository;
|
||||||
private final OwnedLandRepository ownedLandRepository;
|
private final OwnedLandRepository ownedLandRepository;
|
||||||
|
private final OwnedBuildingRepository ownedBuildingRepository;
|
||||||
|
private final BuildingRepository buildingRepository;
|
||||||
|
|
||||||
public boolean isLandOwner(Integer landId){
|
public boolean isLandOwner(Integer landId){
|
||||||
LandAttrib attrib = landRepository.findLandAttrib(landId);
|
LandAttrib attrib = landRepository.findLandAttrib(landId);
|
||||||
@@ -31,4 +38,31 @@ public class DynamodbLandService {
|
|||||||
OwnedLandDoc ownedLand = ownedLandRepository.findOwnedLand(guid, landId);
|
OwnedLandDoc ownedLand = ownedLandRepository.findOwnedLand(guid, landId);
|
||||||
return ownedLand == null ? "" : ownedLand.getCreatedDateTime();
|
return ownedLand == null ? "" : ownedLand.getCreatedDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DynamoDBTransaction
|
||||||
|
public void ChangesLandOwner(LandRequest landRequest){
|
||||||
|
int landId = landRequest.getLandId();
|
||||||
|
int buildingId = landRequest.getBuildingId();
|
||||||
|
String guid = landRequest.getUserGuid();
|
||||||
|
|
||||||
|
LandAttrib landAttrib = landRepository.findLandAttrib(landId);
|
||||||
|
if(landAttrib == null){
|
||||||
|
landRepository.insertLand(landRequest);
|
||||||
|
ownedLandRepository.insert(guid, landId);
|
||||||
|
}else{
|
||||||
|
ownedLandRepository.delete(landAttrib.getOwnerUserGuid(), landId);
|
||||||
|
landRepository.updateLand(landRequest);
|
||||||
|
ownedLandRepository.insert(guid, landId);
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildingAttrib buildingAttrib = buildingRepository.findBuildingAttrib(buildingId);
|
||||||
|
if(buildingAttrib == null){
|
||||||
|
buildingRepository.insertBuilding(landRequest);
|
||||||
|
ownedBuildingRepository.insert(guid, landId);
|
||||||
|
}else{
|
||||||
|
ownedBuildingRepository.delete(buildingAttrib.getOwnerUserGuid(), landId);
|
||||||
|
buildingRepository.updateBuilding(landRequest);
|
||||||
|
ownedBuildingRepository.insert(guid, landId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ public class CommonConstants {
|
|||||||
public static final String CALIUM_ITEM_CODE = "19010003";
|
public static final String CALIUM_ITEM_CODE = "19010003";
|
||||||
public static final String CALIVERSE_CODE = "CALIVERSE";
|
public static final String CALIVERSE_CODE = "CALIVERSE";
|
||||||
public static final String CALIVERSE_NAME = "칼리버스";
|
public static final String CALIVERSE_NAME = "칼리버스";
|
||||||
|
public static final String USER = "USER";
|
||||||
|
public static final String LAND_PUBLIC = "public";
|
||||||
|
public static final String LAND_AUCTION = "auction";
|
||||||
|
public static final String LAND_EVENT = "event";
|
||||||
|
|
||||||
public static final String FORMAT_DATE_ISO_DATETIME_MILLIS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
public static final String FORMAT_DATE_ISO_DATETIME_MILLIS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
||||||
public static final String FORMAT_DATE_DATETIME = "yyyy-MM-dd HH:mm:ss";
|
public static final String FORMAT_DATE_DATETIME = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class DynamoDBConstants {
|
|||||||
public static final String PK_KEY_LAND_AUCTION = "land_auction_registry#global";
|
public static final String PK_KEY_LAND_AUCTION = "land_auction_registry#global";
|
||||||
public static final String PK_KEY_LAND_AUCTION_ACTIVE = "land_auction_activity#global";
|
public static final String PK_KEY_LAND_AUCTION_ACTIVE = "land_auction_activity#global";
|
||||||
public static final String PK_KEY_LAND_AUCTION_HIGHEST_USER = "land_auction_highest_bid_user#global";
|
public static final String PK_KEY_LAND_AUCTION_HIGHEST_USER = "land_auction_highest_bid_user#global";
|
||||||
|
public static final String PK_KEY_LAND_AUCTION_RECORD = "land_auction_record#global";
|
||||||
public static final String PK_KEY_USER_NICKNAME_REGISTRY = "user_nickname_registry#global";
|
public static final String PK_KEY_USER_NICKNAME_REGISTRY = "user_nickname_registry#global";
|
||||||
public static final String PK_KEY_MONEY = "money#";
|
public static final String PK_KEY_MONEY = "money#";
|
||||||
public static final String PK_KEY_LAND = "land#";
|
public static final String PK_KEY_LAND = "land#";
|
||||||
@@ -32,6 +33,10 @@ public class DynamoDBConstants {
|
|||||||
public static final String ATTRIB_LANDAUCTION_HIGHEST_USER = "LandAuctionHighestBidUserAttrib";
|
public static final String ATTRIB_LANDAUCTION_HIGHEST_USER = "LandAuctionHighestBidUserAttrib";
|
||||||
public static final String ATTRIB_USER_NICKNAME_REGISTRY = "UserNicknameRegistryAttrib";
|
public static final String ATTRIB_USER_NICKNAME_REGISTRY = "UserNicknameRegistryAttrib";
|
||||||
public static final String ATTRIB_BATTLE_EVENT = "BattleEventAttrib";
|
public static final String ATTRIB_BATTLE_EVENT = "BattleEventAttrib";
|
||||||
|
public static final String ATTRIB_LAND = "LandAttrib";
|
||||||
|
public static final String ATTRIB_BUILDING = "BuildingAttrib";
|
||||||
|
public static final String ATTRIB_OWNED_LAND = "OwnedLandAttrib";
|
||||||
|
public static final String ATTRIB_OWNED_BUILDING = "OwnedBuildingAttrib";
|
||||||
|
|
||||||
//DOC
|
//DOC
|
||||||
public static final String DOC_SYSTEMMAIL = "SystemMetaMailDoc";
|
public static final String DOC_SYSTEMMAIL = "SystemMetaMailDoc";
|
||||||
@@ -40,6 +45,10 @@ public class DynamoDBConstants {
|
|||||||
public static final String DOC_LANDAUCTION_HIGHEST_USER = "LandAuctionHighestBidUserDoc";
|
public static final String DOC_LANDAUCTION_HIGHEST_USER = "LandAuctionHighestBidUserDoc";
|
||||||
public static final String DOC_USER_NICKNAME_REGISTRY = "UserNicknameRegistryDoc";
|
public static final String DOC_USER_NICKNAME_REGISTRY = "UserNicknameRegistryDoc";
|
||||||
public static final String DOC_BATTLE_EVENT = "BattleEventDoc";
|
public static final String DOC_BATTLE_EVENT = "BattleEventDoc";
|
||||||
|
public static final String DOC_LAND = "LandDoc";
|
||||||
|
public static final String DOC_BUILDING = "BuildingDoc";
|
||||||
|
public static final String DOC_OWNED_LAND = "OwnedLandDoc";
|
||||||
|
public static final String DOC_OWNED_BUILDING = "OwnedBuildingDoc";
|
||||||
|
|
||||||
//SCHEMA
|
//SCHEMA
|
||||||
public static final String SCHEMA_UPDATE_TIME = "UpdatedDateTime";
|
public static final String SCHEMA_UPDATE_TIME = "UpdatedDateTime";
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.caliverse.admin.global.common.constants;
|
|||||||
|
|
||||||
public class MysqlConstants {
|
public class MysqlConstants {
|
||||||
public static String TABLE_NAME_LAND_AUCTION = "land_auction";
|
public static String TABLE_NAME_LAND_AUCTION = "land_auction";
|
||||||
|
public static String TABLE_NAME_LAND_OWNER_CHANGE = "land_ownership_changes";
|
||||||
public static String TABLE_NAME_CALIUM_REQUEST = "calium_request";
|
public static String TABLE_NAME_CALIUM_REQUEST = "calium_request";
|
||||||
public static String TABLE_NAME_EVENT = "event";
|
public static String TABLE_NAME_EVENT = "event";
|
||||||
public static String TABLE_NAME_MAIL = "mail";
|
public static String TABLE_NAME_MAIL = "mail";
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
|
|
||||||
public class DateUtils {
|
public class DateUtils {
|
||||||
public static String stringToDateTime(LocalDateTime date) {
|
public static String stringToDateTime(LocalDateTime date) {
|
||||||
|
if(date == null) return null;
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(CommonConstants.FORMAT_DATE_DATETIME);
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(CommonConstants.FORMAT_DATE_DATETIME);
|
||||||
return date.format(formatter);
|
return date.format(formatter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ public class DynamicScheduler {
|
|||||||
LocalDateTime end_dt = event.getEventEndDt();
|
LocalDateTime end_dt = event.getEventEndDt();
|
||||||
int operation_time = event.getEventOperationTime();
|
int operation_time = event.getEventOperationTime();
|
||||||
|
|
||||||
//자정 체크
|
|
||||||
LocalTime endTime = startTime.plusSeconds(operation_time);
|
LocalTime endTime = startTime.plusSeconds(operation_time);
|
||||||
|
|
||||||
// 현재시간이 자정을 넘어간 경우(00:00 ~ endTime)라면 전날을 기준으로
|
// 현재시간이 자정을 넘어간 경우(00:00 ~ endTime)라면 전날을 기준으로
|
||||||
|
|||||||
@@ -25,6 +25,21 @@
|
|||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="updateDt" column="update_dt"/>
|
<result property="updateDt" column="update_dt"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<resultMap id="LandOwnerChangeResultMap" type="com.caliverse.admin.domain.entity.LandOwnerChange">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="landId" column="land_id"/>
|
||||||
|
<result property="landName" column="land_name"/>
|
||||||
|
<result property="buildingId" column="building_id"/>
|
||||||
|
<result property="buildingName" column="building_name"/>
|
||||||
|
<result property="userGuid" column="user_guid"/>
|
||||||
|
<result property="isReserve" column="is_reserve"/>
|
||||||
|
<result property="reservationDt" column="reservation_dt"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createDt" column="create_dt"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateDt" column="update_dt"/>
|
||||||
|
</resultMap>
|
||||||
<resultMap id="MessageResultMap" type="com.caliverse.admin.domain.entity.Message">
|
<resultMap id="MessageResultMap" type="com.caliverse.admin.domain.entity.Message">
|
||||||
<result property="title" column="title"/>
|
<result property="title" column="title"/>
|
||||||
<result property="language" column="language"/>
|
<result property="language" column="language"/>
|
||||||
@@ -123,9 +138,9 @@
|
|||||||
, (SELECT @row_number:=0) AS t
|
, (SELECT @row_number:=0) AS t
|
||||||
) Z
|
) Z
|
||||||
ORDER BY
|
ORDER BY
|
||||||
CASE WHEN Z.status = 'FAIL' OR Z.status = 'CANCEL' THEN 1 ELSE 0 END,
|
CASE WHEN Z.status = 'FAIL' OR Z.status = 'CANCEL' THEN 1 ELSE 0 END
|
||||||
<if test="orderby != null and orderby != ''">
|
<if test="orderby != null and orderby != ''">
|
||||||
row_num ${orderby}
|
,row_num ${orderby}
|
||||||
</if>
|
</if>
|
||||||
<if test="pageSize != null and pageSize != ''">
|
<if test="pageSize != null and pageSize != ''">
|
||||||
LIMIT ${pageSize} OFFSET ${offset}
|
LIMIT ${pageSize} OFFSET ${offset}
|
||||||
@@ -219,6 +234,22 @@
|
|||||||
WHERE a.id = #{id}
|
WHERE a.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getLandOwnerChangeDetail" parameterType="java.lang.Long" resultMap="LandOwnerChangeResultMap" >
|
||||||
|
SELECT
|
||||||
|
a.id
|
||||||
|
, a.land_id
|
||||||
|
, a.land_name
|
||||||
|
, a.user_guid
|
||||||
|
, a.reservation_dt
|
||||||
|
, a.status
|
||||||
|
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
|
||||||
|
, a.create_dt
|
||||||
|
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
|
||||||
|
, a.update_dt
|
||||||
|
FROM land_ownership_changes a
|
||||||
|
WHERE a.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getMessage" parameterType="java.lang.Long" resultMap="MessageResultMap" >
|
<select id="getMessage" parameterType="java.lang.Long" resultMap="MessageResultMap" >
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
@@ -233,6 +264,11 @@
|
|||||||
VALUES (#{landId}, #{landName}, #{landSize}, #{landSocket}, #{auctionSeq}, #{resvStartDt}, #{resvEndDt}, #{auctionStartDt}, #{auctionEndDt}, #{currencyType}, #{startPrice}, #{createBy}, #{updateBy})
|
VALUES (#{landId}, #{landName}, #{landSize}, #{landSocket}, #{auctionSeq}, #{resvStartDt}, #{resvEndDt}, #{auctionStartDt}, #{auctionEndDt}, #{currencyType}, #{startPrice}, #{createBy}, #{updateBy})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="postLandOwnerChange" parameterType="com.caliverse.admin.domain.request.LandRequest" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO land_ownership_changes (land_id, land_name, building_id, building_name, user_guid, is_reserve, reservation_dt, create_by, update_by)
|
||||||
|
VALUES (#{landId}, #{landName}, #{buildingId}, #{buildingName}, #{userGuid}, #{isReserve}, #{reservationDt}, #{createBy}, #{updateBy})
|
||||||
|
</insert>
|
||||||
|
|
||||||
<insert id="insertMessage" parameterType="map">
|
<insert id="insertMessage" parameterType="map">
|
||||||
INSERT INTO message (target_id, type, content, language)
|
INSERT INTO message (target_id, type, content, language)
|
||||||
VALUES (#{id}, 'LANDAUCTION', #{content}, #{language})
|
VALUES (#{id}, 'LANDAUCTION', #{content}, #{language})
|
||||||
@@ -251,6 +287,15 @@
|
|||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateLandOwnerChange" parameterType="com.caliverse.admin.domain.request.LandRequest">
|
||||||
|
UPDATE land_ownership_changes
|
||||||
|
SET user_guid = #{userGuid}
|
||||||
|
, reservation_dt = #{reservationDt}
|
||||||
|
, update_by = #{updateBy}
|
||||||
|
, update_dt = NOW()
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="deleteMessage" parameterType="map">
|
<update id="deleteMessage" parameterType="map">
|
||||||
DELETE FROM message
|
DELETE FROM message
|
||||||
WHERE target_id = #{id}
|
WHERE target_id = #{id}
|
||||||
@@ -282,6 +327,12 @@
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateStatusLandOwnedChange" parameterType="map">
|
||||||
|
UPDATE land_ownership_changes
|
||||||
|
SET status = #{status}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getScheduleLandAuctionList" resultMap="LandAuctionResultMap">
|
<select id="getScheduleLandAuctionList" resultMap="LandAuctionResultMap">
|
||||||
SELECT id
|
SELECT id
|
||||||
, land_id
|
, land_id
|
||||||
@@ -298,4 +349,20 @@
|
|||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getScheduleLandOwnedChangeList" resultMap="LandOwnerChangeResultMap">
|
||||||
|
SELECT id
|
||||||
|
, land_id
|
||||||
|
, land_name
|
||||||
|
, building_id
|
||||||
|
, building_name
|
||||||
|
, status
|
||||||
|
, user_guid
|
||||||
|
, is_reserve
|
||||||
|
, reservation_dt
|
||||||
|
FROM land_ownership_changes
|
||||||
|
WHERE (status = 'WAIT')
|
||||||
|
AND deleted = 0
|
||||||
|
AND is_reserve = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user