공지 정렬 수정
히스토리 caliverse_meta_data 제거
This commit is contained in:
@@ -44,6 +44,7 @@ public class CaliumResponse {
|
|||||||
@JsonProperty("total_all")
|
@JsonProperty("total_all")
|
||||||
// private int totalAll;
|
// private int totalAll;
|
||||||
private double totalAll;
|
private double totalAll;
|
||||||
|
private Integer failCount;
|
||||||
@JsonProperty("page_no")
|
@JsonProperty("page_no")
|
||||||
private int pageNo;
|
private int pageNo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ import com.caliverse.admin.domain.response.AdminResponse;
|
|||||||
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;
|
||||||
import com.caliverse.admin.global.common.code.SuccessCode;
|
import com.caliverse.admin.global.common.code.SuccessCode;
|
||||||
|
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
||||||
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.global.common.utils.CommonUtils;
|
||||||
|
import com.caliverse.admin.mongodb.service.MysqlHistoryLogService;
|
||||||
import jakarta.mail.internet.MimeMessage;
|
import jakarta.mail.internet.MimeMessage;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -37,6 +39,7 @@ import java.util.*;
|
|||||||
public class AdminService {
|
public class AdminService {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(AdminService.class);
|
private static final Logger logger = LoggerFactory.getLogger(AdminService.class);
|
||||||
|
|
||||||
|
private final MysqlHistoryLogService mysqlHistoryLogService;
|
||||||
private final AdminMapper adminMapper;
|
private final AdminMapper adminMapper;
|
||||||
private final GroupMapper groupMapper;
|
private final GroupMapper groupMapper;
|
||||||
private final PasswordEncoder passwordEncoder;
|
private final PasswordEncoder passwordEncoder;
|
||||||
@@ -170,8 +173,9 @@ public class AdminService {
|
|||||||
Map<String , Object> map = new HashMap<>();
|
Map<String , Object> map = new HashMap<>();
|
||||||
adminRequest.getList().forEach(
|
adminRequest.getList().forEach(
|
||||||
item -> {
|
item -> {
|
||||||
|
String email = item.getEmail();
|
||||||
map.put("email", item.getEmail());
|
Optional<Admin> info = adminMapper.findByEmail(email);
|
||||||
|
map.put("email", email);
|
||||||
map.put("id", CommonUtils.getAdmin().getId());
|
map.put("id", CommonUtils.getAdmin().getId());
|
||||||
|
|
||||||
if(item.getIsApprove().equals(AdminRequest.Approve.APPROVE)){
|
if(item.getIsApprove().equals(AdminRequest.Approve.APPROVE)){
|
||||||
@@ -184,18 +188,13 @@ public class AdminService {
|
|||||||
//로그인 승인
|
//로그인 승인
|
||||||
adminMapper.updateStatus(map);
|
adminMapper.updateStatus(map);
|
||||||
|
|
||||||
//로그 기록
|
mysqlHistoryLogService.updateHistoryLog(
|
||||||
Optional<Admin> admin = adminMapper.findByEmail(item.getEmail());
|
HISTORYTYPEDETAIL.LOGIN_PERMITTED,
|
||||||
// map.put("adminId", admin.get().getId());
|
MysqlConstants.TABLE_NAME_ADMIN,
|
||||||
// map.put("name", CommonUtils.getAdmin().getName());
|
HISTORYTYPEDETAIL.LOGIN_PERMITTED.name(),
|
||||||
// map.put("mail", CommonUtils.getAdmin().getEmail());
|
info.get(),
|
||||||
// map.put("type", HISTORYTYPE.LOGIN_PERMITTED);
|
adminMapper.findByEmail(email)
|
||||||
JSONObject jsonObject = new JSONObject();
|
);
|
||||||
jsonObject.put("name",admin.get().getName());
|
|
||||||
jsonObject.put("email",item.getEmail());
|
|
||||||
// map.put("content",jsonObject.toString());
|
|
||||||
// historyMapper.saveLog(map);
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.LOGIN_PERMITTED, jsonObject);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -214,32 +213,24 @@ public class AdminService {
|
|||||||
Map<String , Object> map = new HashMap<>();
|
Map<String , Object> map = new HashMap<>();
|
||||||
adminRequest.getList().forEach(
|
adminRequest.getList().forEach(
|
||||||
item -> {
|
item -> {
|
||||||
map.put("email", item.getEmail());
|
String email = item.getEmail();
|
||||||
|
map.put("email", email);
|
||||||
map.put("group_id", item.getGroupId());
|
map.put("group_id", item.getGroupId());
|
||||||
map.put("id", CommonUtils.getAdmin().getId());
|
map.put("id", CommonUtils.getAdmin().getId());
|
||||||
|
|
||||||
//변경전 그룹 명세 조회
|
//변경전 그룹 명세 조회
|
||||||
Optional<Admin> admin = adminMapper.findByEmail(item.getEmail());
|
Optional<Admin> info = adminMapper.findByEmail(email);
|
||||||
|
|
||||||
Map<String, String> beforeGroup = groupMapper.getGroupInfo(admin.get().getGroupId());
|
|
||||||
//쿼리 실행
|
//쿼리 실행
|
||||||
adminMapper.updateGroup(map);
|
adminMapper.updateGroup(map);
|
||||||
//로그 기록
|
|
||||||
//변경후 그룹 명세 조회
|
|
||||||
Map<String, String> afterGroup = groupMapper.getGroupInfo(item.getGroupId());
|
|
||||||
|
|
||||||
// map.put("adminId", CommonUtils.getAdmin().getId());
|
mysqlHistoryLogService.updateHistoryLog(
|
||||||
// map.put("name", CommonUtils.getAdmin().getName());
|
HISTORYTYPEDETAIL.ADMIN_INFO_UPDATE,
|
||||||
// map.put("mail", CommonUtils.getAdmin().getEmail());
|
MysqlConstants.TABLE_NAME_ADMIN,
|
||||||
// map.put("type", HISTORYTYPE.ADMIN_INFO_UPDATE);
|
HISTORYTYPEDETAIL.ADMIN_INFO_UPDATE.name(),
|
||||||
JSONObject jsonObject = new JSONObject();
|
info.get(),
|
||||||
jsonObject.put("name",admin.get().getName());
|
adminMapper.findByEmail(email)
|
||||||
jsonObject.put("email",item.getEmail());
|
);
|
||||||
jsonObject.put("Authority(Before)", beforeGroup != null?beforeGroup.get("name"):"");
|
|
||||||
jsonObject.put("Authority(after)", afterGroup != null? afterGroup.get("name"):"");
|
|
||||||
// map.put("content",jsonObject.toString());
|
|
||||||
// historyMapper.saveLog(map);
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.ADMIN_INFO_UPDATE, jsonObject);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -260,21 +251,17 @@ public class AdminService {
|
|||||||
map.put("email", item.getEmail());
|
map.put("email", item.getEmail());
|
||||||
map.put("deleted", String.valueOf(1));
|
map.put("deleted", String.valueOf(1));
|
||||||
//로그 기록
|
//로그 기록
|
||||||
Optional<Admin> admin = adminMapper.findByEmail(item.getEmail());
|
Optional<Admin> info = adminMapper.findByEmail(item.getEmail());
|
||||||
|
|
||||||
//쿼리 실행
|
//쿼리 실행
|
||||||
adminMapper.deleteAdmin(map);
|
adminMapper.deleteAdmin(map);
|
||||||
|
|
||||||
// map.put("adminId", CommonUtils.getAdmin().getId());
|
mysqlHistoryLogService.deleteHistoryLog(
|
||||||
// map.put("name", CommonUtils.getAdmin().getName());
|
HISTORYTYPEDETAIL.ADMIN_INFO_DELETE,
|
||||||
// map.put("mail", CommonUtils.getAdmin().getEmail());
|
MysqlConstants.TABLE_NAME_ADMIN,
|
||||||
// map.put("type", HISTORYTYPE.ADMIN_INFO_DELETE);
|
HISTORYTYPEDETAIL.ADMIN_INFO_DELETE.name(),
|
||||||
JSONObject jsonObject = new JSONObject();
|
info.get()
|
||||||
jsonObject.put("name",admin.get().getName());
|
);
|
||||||
jsonObject.put("email",item.getEmail());
|
|
||||||
// map.put("content",jsonObject.toString());
|
|
||||||
// historyMapper.saveLog(map);
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.ADMIN_INFO_DELETE, jsonObject);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
log.info("deleteAdmin Deleted Admin: {}", map);
|
log.info("deleteAdmin Deleted Admin: {}", map);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.caliverse.admin.domain.entity.web3.ResponseErrorCode;
|
|||||||
import com.caliverse.admin.domain.entity.web3.ResponseRequestData;
|
import com.caliverse.admin.domain.entity.web3.ResponseRequestData;
|
||||||
import com.caliverse.admin.domain.entity.web3.ResponseWithdrawableData;
|
import com.caliverse.admin.domain.entity.web3.ResponseWithdrawableData;
|
||||||
import com.caliverse.admin.domain.request.CaliumRequest;
|
import com.caliverse.admin.domain.request.CaliumRequest;
|
||||||
|
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||||
import com.caliverse.admin.domain.request.Web3Request;
|
import com.caliverse.admin.domain.request.Web3Request;
|
||||||
import com.caliverse.admin.domain.response.CaliumResponse;
|
import com.caliverse.admin.domain.response.CaliumResponse;
|
||||||
import com.caliverse.admin.domain.response.Web3Response;
|
import com.caliverse.admin.domain.response.Web3Response;
|
||||||
@@ -17,6 +18,9 @@ import com.caliverse.admin.global.common.code.SuccessCode;
|
|||||||
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
||||||
import com.caliverse.admin.global.common.constants.Web3Constants;
|
import com.caliverse.admin.global.common.constants.Web3Constants;
|
||||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||||
|
import com.caliverse.admin.logs.Indicatordomain.GenericMongoLog;
|
||||||
|
import com.caliverse.admin.logs.entity.LogAction;
|
||||||
|
import com.caliverse.admin.logs.logservice.businesslogservice.BusinessLogGenericService;
|
||||||
import com.caliverse.admin.mongodb.service.MysqlHistoryLogService;
|
import com.caliverse.admin.mongodb.service.MysqlHistoryLogService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -25,6 +29,7 @@ import org.springframework.http.HttpMethod;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -41,6 +46,7 @@ public class CaliumService {
|
|||||||
// private final DynamoDBService dynamoDBService;
|
// private final DynamoDBService dynamoDBService;
|
||||||
private final DynamodbCaliumService dynamodbCaliumService;
|
private final DynamodbCaliumService dynamodbCaliumService;
|
||||||
private final MysqlHistoryLogService mysqlHistoryLogService;
|
private final MysqlHistoryLogService mysqlHistoryLogService;
|
||||||
|
private final BusinessLogGenericService businessLogGenericService;
|
||||||
|
|
||||||
public CaliumResponse getCaliumLimit(){
|
public CaliumResponse getCaliumLimit(){
|
||||||
Web3Response<ResponseWithdrawableData> web3Response = web3Service.get(
|
Web3Response<ResponseWithdrawableData> web3Response = web3Service.get(
|
||||||
@@ -82,6 +88,13 @@ public class CaliumService {
|
|||||||
double allCnt = caliumMapper.getCaliumTotal();
|
double allCnt = caliumMapper.getCaliumTotal();
|
||||||
double stock_qty = dynamodbCaliumService.getCaliumTotal();
|
double stock_qty = dynamodbCaliumService.getCaliumTotal();
|
||||||
|
|
||||||
|
LogGenericRequest logGenericRequest = new LogGenericRequest();
|
||||||
|
logGenericRequest.setLogAction(LogAction.FailCaliumEchoSystem);
|
||||||
|
logGenericRequest.setStartDt(LocalDateTime.now().minusDays(1));
|
||||||
|
logGenericRequest.setEndDt(LocalDateTime.now());
|
||||||
|
logGenericRequest.setOrderBy("ASC");
|
||||||
|
List<GenericMongoLog> failList = businessLogGenericService.loadBusinessLogData(logGenericRequest, GenericMongoLog.class);
|
||||||
|
|
||||||
return CaliumResponse.builder()
|
return CaliumResponse.builder()
|
||||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||||
.result(CommonCode.SUCCESS.getResult())
|
.result(CommonCode.SUCCESS.getResult())
|
||||||
@@ -89,6 +102,7 @@ public class CaliumService {
|
|||||||
.caliumList(list)
|
.caliumList(list)
|
||||||
.total(stock_qty)
|
.total(stock_qty)
|
||||||
.totalAll(allCnt)
|
.totalAll(allCnt)
|
||||||
|
.failCount(failList.size())
|
||||||
.pageNo(requestParam.get("page_no")!=null?
|
.pageNo(requestParam.get("page_no")!=null?
|
||||||
Integer.parseInt(requestParam.get("page_no").toString()):1)
|
Integer.parseInt(requestParam.get("page_no").toString()):1)
|
||||||
.build()
|
.build()
|
||||||
@@ -153,13 +167,6 @@ public class CaliumService {
|
|||||||
calium
|
calium
|
||||||
);
|
);
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("dept",caliumRequest.getDept());
|
|
||||||
jsonObject.put("count",caliumRequest.getCount());
|
|
||||||
jsonObject.put("content",caliumRequest.getContent());
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.CALIUM_ADD, jsonObject);
|
|
||||||
|
|
||||||
return CaliumResponse.builder()
|
return CaliumResponse.builder()
|
||||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||||
.result(CommonCode.SUCCESS.getResult())
|
.result(CommonCode.SUCCESS.getResult())
|
||||||
@@ -173,10 +180,10 @@ public class CaliumService {
|
|||||||
public CaliumResponse updateCaliumCharged(CaliumRequest caliumRequest){
|
public CaliumResponse updateCaliumCharged(CaliumRequest caliumRequest){
|
||||||
log.info("updateCaliumCharged calium Request: {}", caliumRequest);
|
log.info("updateCaliumCharged calium Request: {}", caliumRequest);
|
||||||
Calium calium = caliumMapper.getCaliumRequestDetail(caliumRequest.getId());
|
Calium calium = caliumMapper.getCaliumRequestDetail(caliumRequest.getId());
|
||||||
Long id = CommonUtils.getAdmin().getId();
|
Long userId = CommonUtils.getAdmin().getId();
|
||||||
// 상태가 승인완료거나 요청한 본인이 아니면 에러처리
|
// 상태가 승인완료거나 요청한 본인이 아니면 에러처리
|
||||||
if(!calium.getStatus().equals(Calium.CALIUMREQUESTSTATUS.COMPLETE) || !calium.getCreateBy().equals(id.toString())){
|
if(!calium.getStatus().equals(Calium.CALIUMREQUESTSTATUS.COMPLETE) || !calium.getCreateBy().equals(userId.toString())){
|
||||||
log.error("updateCaliumCharged Calium Request Status or User Not Match status: {}, id: {}", calium.getStatus(), id);
|
log.error("updateCaliumCharged Calium Request Status or User Not Match status: {}, id: {}", calium.getStatus(), userId);
|
||||||
return CaliumResponse.builder()
|
return CaliumResponse.builder()
|
||||||
.status(CommonCode.ERROR.getHttpStatus())
|
.status(CommonCode.ERROR.getHttpStatus())
|
||||||
.result(ErrorCode.ERROR_CALIUM_FINISH.toString())
|
.result(ErrorCode.ERROR_CALIUM_FINISH.toString())
|
||||||
@@ -186,14 +193,24 @@ public class CaliumService {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Calium info = caliumMapper.getCaliumRequestDetail(caliumRequest.getId());
|
||||||
|
|
||||||
dynamodbCaliumService.updateCaliumTotal(caliumRequest.getCount());
|
dynamodbCaliumService.updateCaliumTotal(caliumRequest.getCount());
|
||||||
|
|
||||||
updateCaliumRequest(caliumRequest.getId(), Calium.CALIUMREQUESTSTATUS.FINISH);
|
updateCaliumRequest(caliumRequest.getId(), Calium.CALIUMREQUESTSTATUS.FINISH);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
mysqlHistoryLogService.updateHistoryLog(
|
||||||
|
HISTORYTYPEDETAIL.CALIUM_TOTAL_UPDATE,
|
||||||
|
MysqlConstants.TABLE_NAME_CALIUM_REQUEST,
|
||||||
|
HISTORYTYPEDETAIL.CALIUM_TOTAL_UPDATE.name(),
|
||||||
|
info,
|
||||||
|
caliumMapper.getCaliumRequestDetail(caliumRequest.getId())
|
||||||
|
);
|
||||||
|
|
||||||
|
// JSONObject jsonObject = new JSONObject();
|
||||||
// jsonObject.put("dynamoDB_update",dynamoResult);
|
// jsonObject.put("dynamoDB_update",dynamoResult);
|
||||||
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.CALIUM_TOTAL_UPDATE, jsonObject);
|
// historyService.setLog(HISTORYTYPEDETAIL.CALIUM_TOTAL_UPDATE, jsonObject);
|
||||||
|
|
||||||
return CaliumResponse.builder()
|
return CaliumResponse.builder()
|
||||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||||
|
|||||||
@@ -225,20 +225,6 @@ public class EventService {
|
|||||||
HISTORYTYPEDETAIL.EVENT_DELETE.name(),
|
HISTORYTYPEDETAIL.EVENT_DELETE.name(),
|
||||||
event
|
event
|
||||||
);
|
);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
// if(result == 1){
|
|
||||||
// String dynamoResult = dynamoDBService.deleteSystemMail(item.getId().toString());
|
|
||||||
// jsonObject.put("dynamoDB_data",dynamoResult);
|
|
||||||
// log.info("updateEvent dynamoDB Delete Complete: {}", dynamoResult);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
List<Message> message = eventMapper.getMessage(item.getId());
|
|
||||||
if(!message.isEmpty()){
|
|
||||||
jsonObject.put("message",message.get(0).getTitle());
|
|
||||||
}
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.EVENT_DELETE, jsonObject);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class GroupService {
|
|||||||
|
|
||||||
//권한 그룹 등록
|
//권한 그룹 등록
|
||||||
public GroupResponse postAdminGroup(GroupRequest groupRequest){
|
public GroupResponse postAdminGroup(GroupRequest groupRequest){
|
||||||
List<Integer> authList = Arrays.asList(1, 5, 6, 9, 10, 11, 13, 14, 15, 16, 19, 22, 24, 26, 32); //그룹 초기 권한
|
List<Integer> authList = Arrays.asList(1, 5, 6, 9, 10, 11, 13, 14, 15, 16, 19, 22, 24, 26, 32, 36, 41,46, 49); //그룹 초기 권한
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
groupRequest.setCreateBy(CommonUtils.getAdmin().getId());
|
groupRequest.setCreateBy(CommonUtils.getAdmin().getId());
|
||||||
|
|
||||||
|
|||||||
@@ -107,57 +107,6 @@ public class HistoryService {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void insertMetaData(File file) {
|
|
||||||
try {
|
|
||||||
// Read the JSON data from the file
|
|
||||||
String jsonData = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// Parse the JSON data into a JSONArray
|
|
||||||
JSONArray jsonArray = new JSONArray(jsonData);
|
|
||||||
|
|
||||||
|
|
||||||
// Iterate over the elements in the JSONArray
|
|
||||||
for (int i = 0; i < jsonArray.length(); i++) {
|
|
||||||
// Get the current element as a JSONObject
|
|
||||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
||||||
|
|
||||||
// Extract the values from the JSONObject
|
|
||||||
Integer itemId = Integer.valueOf(jsonObject.getInt("item_id"));
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> item = new HashMap<>();
|
|
||||||
item.put("fileName", file.getName());
|
|
||||||
item.put("dataId", itemId);
|
|
||||||
item.put("jsonData", jsonObject.toString());
|
|
||||||
|
|
||||||
|
|
||||||
// Insert the values into MariaDB
|
|
||||||
|
|
||||||
historyMapper.insertMetaData(item);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (java.io.IOException e) {
|
|
||||||
log.error("insertMetaData IOException: {}", e.getMessage());
|
|
||||||
} catch (JSONException e) {
|
|
||||||
log.error("insertMetaData JSONException: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLog(HISTORYTYPEDETAIL type, JSONObject content){
|
|
||||||
//로그 기록
|
|
||||||
Map<String, Object> logMap = new HashMap<>();
|
|
||||||
logMap.put("adminId", CommonUtils.getAdmin().getId());
|
|
||||||
logMap.put("name", CommonUtils.getAdmin().getName());
|
|
||||||
logMap.put("mail", CommonUtils.getAdmin().getEmail());
|
|
||||||
logMap.put("type", type);
|
|
||||||
logMap.put("content",content.toString());
|
|
||||||
historyMapper.saveLog(logMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScheduleLog(HISTORYTYPEDETAIL type, String message){
|
public void setScheduleLog(HISTORYTYPEDETAIL type, String message){
|
||||||
//스케줄 로그 기록
|
//스케줄 로그 기록
|
||||||
Map<String, Object> logMap = new HashMap<>();
|
Map<String, Object> logMap = new HashMap<>();
|
||||||
|
|||||||
@@ -627,17 +627,6 @@ public class LandService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
dynamodbLandAuctionService.cancelLandAuction(auction_info);
|
dynamodbLandAuctionService.cancelLandAuction(auction_info);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
List<Message> message = landMapper.getMessage(item.getId());
|
|
||||||
if(!message.isEmpty()){
|
|
||||||
jsonObject.put("message",message.get(0).getTitle());
|
|
||||||
}
|
|
||||||
jsonObject.put("auction_info", auction_info);
|
|
||||||
// jsonObject.put("dynamoDB_result",land_auction_registry_result);
|
|
||||||
historyService.setLog(HISTORYTYPEDETAIL.LAND_AUCTION_DELETE, jsonObject);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.data.mongodb.UncategorizedMongoDbException;
|
import org.springframework.data.mongodb.UncategorizedMongoDbException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -31,6 +32,11 @@ public class LogService {
|
|||||||
// logGenericRequest.setEndDt(endDt);
|
// logGenericRequest.setEndDt(endDt);
|
||||||
|
|
||||||
// List<Map<String, Object>> logList = businessLogGenericService.loadBusinessLogData(logGenericRequest);
|
// List<Map<String, Object>> logList = businessLogGenericService.loadBusinessLogData(logGenericRequest);
|
||||||
|
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||||
|
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||||
|
logGenericRequest.setStartDt(startDt);
|
||||||
|
logGenericRequest.setEndDt(endDt);
|
||||||
|
|
||||||
List<GenericMongoLog> logList = new ArrayList<>();
|
List<GenericMongoLog> logList = new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
logList = businessLogGenericService.loadBusinessLogData(logGenericRequest, GenericMongoLog.class);
|
logList = businessLogGenericService.loadBusinessLogData(logGenericRequest, GenericMongoLog.class);
|
||||||
|
|||||||
@@ -105,16 +105,6 @@ public class NoticeService {
|
|||||||
noticeMapper.getNoticeDetail(noticeRequest.getId())
|
noticeMapper.getNoticeDetail(noticeRequest.getId())
|
||||||
);
|
);
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
|
||||||
// jsonObject.put("message_type",noticeRequest.getMessageType());
|
|
||||||
// jsonObject.put("repeat_type",noticeRequest.getRepeatType());
|
|
||||||
// jsonObject.put("repeat_cnt",noticeRequest.getRepeatCnt());
|
|
||||||
// jsonObject.put("repeat_dt",noticeRequest.getRepeatDt());
|
|
||||||
// jsonObject.put("send_dt",noticeRequest.getSendDt());
|
|
||||||
// jsonObject.put("end_dt",noticeRequest.getEndDt());
|
|
||||||
// jsonObject.put("message",noticeRequest.getGameMessages().toString());
|
|
||||||
// historyService.setLog(HISTORYTYPE.NOTICE_ADD, jsonObject);
|
|
||||||
|
|
||||||
return NoticeResponse.builder()
|
return NoticeResponse.builder()
|
||||||
.resultData(NoticeResponse.ResultData.builder().message(SuccessCode.REGISTRATION.getMessage()).build())
|
.resultData(NoticeResponse.ResultData.builder().message(SuccessCode.REGISTRATION.getMessage()).build())
|
||||||
@@ -196,15 +186,6 @@ public class NoticeService {
|
|||||||
noticeMapper.getNoticeDetail(item.getMessageId())
|
noticeMapper.getNoticeDetail(item.getMessageId())
|
||||||
);
|
);
|
||||||
|
|
||||||
//로그 기록
|
|
||||||
// map.put("adminId", CommonUtils.getAdmin().getId());
|
|
||||||
// map.put("name", CommonUtils.getAdmin().getName());
|
|
||||||
// map.put("mail", CommonUtils.getAdmin().getEmail());
|
|
||||||
// map.put("type", HISTORYTYPE.NOTICE_DELETE);
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
|
||||||
// jsonObject.put("message",message);
|
|
||||||
// map.put("content",jsonObject.toString());
|
|
||||||
// historyMapper.saveLog(map);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
log.info("deleteInGameMessage notice: {}", noticeRequest);
|
log.info("deleteInGameMessage notice: {}", noticeRequest);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ public class MysqlConstants {
|
|||||||
public static String TABLE_NAME_LAND_OWNER_CHANGE = "land_ownership_changes";
|
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_ADMIN = "admin";
|
||||||
public static String TABLE_NAME_MENU_BANNER = "menu_banner";
|
public static String TABLE_NAME_MENU_BANNER = "menu_banner";
|
||||||
public static String TABLE_NAME_USER_BLOCK = "black_list";
|
public static String TABLE_NAME_USER_BLOCK = "black_list";
|
||||||
public static String TABLE_NAME_MAIL = "mail";
|
public static String TABLE_NAME_MAIL = "mail";
|
||||||
|
|||||||
@@ -215,6 +215,25 @@ public enum LogAction {
|
|||||||
UserLogout("유저 로그아웃"),
|
UserLogout("유저 로그아웃"),
|
||||||
UserLogoutSnapShot("게임 로그아웃 스냅샷"),
|
UserLogoutSnapShot("게임 로그아웃 스냅샷"),
|
||||||
UserReport("유저 신고"),
|
UserReport("유저 신고"),
|
||||||
|
ItemDestroyByUser("아이템 제거 (사용자에 의해)"),
|
||||||
|
ItemDestoryByExpiration("아이템 제거 (기간만료에 의해)"),
|
||||||
|
|
||||||
|
// 퀘스트 관련
|
||||||
|
QuestMainAssign("퀘스트 메인 수락"),
|
||||||
|
|
||||||
|
// 비컨 상점 관련
|
||||||
|
BeaconShopRegisterItem("비컨 상점에 아이템 등록"),
|
||||||
|
BeaconShopReturnItem("비컨 상점 아이템 회수"),
|
||||||
|
BeaconShopPurchaseItem("비컨 상점에서 아이템 구매"),
|
||||||
|
BeaconShopReceivePaymentForSales("비컨 상점 판매한 아이템 정산 받기"),
|
||||||
|
BeaconShopSearchItem("비컨 상점 아이템 검색"),
|
||||||
|
BeaconShopUpdateDailyCount("비컨 상점 하루 제한 업데이트"),
|
||||||
|
BeaconShopDeleteRecord("비컨 상점 기록 영수증 제거"),
|
||||||
|
BeaconShopDeactiveItems("비컨 상점 아이템 비활성화"),
|
||||||
|
|
||||||
|
// 치트 명령어 관련
|
||||||
|
CheatCommandBeaconShopItemTimeChange("치트로 인한 비컨 상점 시간 변경"),
|
||||||
|
CheatCommandDailyLimitInit("치트로 인한 비컨 상점 일일 횟수 초기화"),
|
||||||
Warp("워프");
|
Warp("워프");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,16 @@ public enum LogDomain {
|
|||||||
BattleRoomJoin("전투 입장"),
|
BattleRoomJoin("전투 입장"),
|
||||||
BattleDead("전투 죽음"),
|
BattleDead("전투 죽음"),
|
||||||
BattleRound("전투 라운드"),
|
BattleRound("전투 라운드"),
|
||||||
|
BeaconShopSoldRecord("비컨 상점 영수증"),
|
||||||
|
BeaconShopSoldPrice("비컨 상점 정산금"),
|
||||||
|
|
||||||
|
// BrokerApi 하위 도메인들
|
||||||
|
PlanetProviderAuth("플래닛 컨텐츠 제공자 인증"),
|
||||||
|
PlanetUserAuth("플래닛 유저 인증"),
|
||||||
|
PlanetItemExchange("플래닛 아이템 교환"),
|
||||||
|
|
||||||
|
// IgmApi (전체 도메인이 누락됨)
|
||||||
|
IgmApi("IgmApi"),
|
||||||
BattleSnapshot("전투 스냅샷");
|
BattleSnapshot("전투 스냅샷");
|
||||||
|
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ public class BusinessLogGenericService extends BusinessLogServiceBase {
|
|||||||
|
|
||||||
// public List<Map<String, Object>> loadBusinessLogData(LogGenericRequest logGenericRequest) {
|
// public List<Map<String, Object>> loadBusinessLogData(LogGenericRequest logGenericRequest) {
|
||||||
public <T> List<T> loadBusinessLogData(LogGenericRequest logGenericRequest, Class<T> class1, boolean isSimple) {
|
public <T> List<T> loadBusinessLogData(LogGenericRequest logGenericRequest, Class<T> class1, boolean isSimple) {
|
||||||
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
// LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||||
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
// LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||||
|
|
||||||
String startTime = startDt.toString().substring(0, 10);
|
String startTime = logGenericRequest.getStartDt().toString().substring(0, 10);
|
||||||
String endTime = endDt.toString().substring(0, 10);
|
String endTime = logGenericRequest.getEndDt().toString().substring(0, 10);
|
||||||
LogAction logAction = logGenericRequest.getLogAction();
|
LogAction logAction = logGenericRequest.getLogAction();
|
||||||
LogDomain logDomain = logGenericRequest.getLogDomain();
|
LogDomain logDomain = logGenericRequest.getLogDomain();
|
||||||
SearchUserType searchUserType = logGenericRequest.getSearchType();
|
SearchUserType searchUserType = logGenericRequest.getSearchType();
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.caliverse.admin.scheduler.polling.service;
|
||||||
|
|
||||||
|
import com.caliverse.admin.domain.entity.LandOwnerChange;
|
||||||
|
import com.caliverse.admin.domain.request.LandRequest;
|
||||||
|
import com.caliverse.admin.domain.service.LandService;
|
||||||
|
import com.caliverse.admin.domain.service.UserGameSessionService;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamodbLandService;
|
||||||
|
import com.caliverse.admin.dynamodb.service.DynamodbMailService;
|
||||||
|
import com.caliverse.admin.scheduler.CommonScheduler;
|
||||||
|
import com.caliverse.admin.scheduler.entity.SchedulerType;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class NoticeScheduler extends CommonScheduler {
|
||||||
|
|
||||||
|
private final LandService landService;
|
||||||
|
private final DynamodbLandService dynamodbLandService;
|
||||||
|
private final DynamodbMailService dynamodbMailService;
|
||||||
|
private final UserGameSessionService userGameSessionService;
|
||||||
|
|
||||||
|
public NoticeScheduler(LandService landService, DynamodbLandService dynamodbLandService, DynamodbMailService dynamodbMailService, UserGameSessionService userGameSessionService) {
|
||||||
|
this.landService = landService;
|
||||||
|
this.dynamodbLandService = dynamodbLandService;
|
||||||
|
this.dynamodbMailService = dynamodbMailService;
|
||||||
|
this.userGameSessionService = userGameSessionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void executeInternal() {
|
||||||
|
List<LandOwnerChange> scheduleList = landService.getScheduleLandOwnerChangesList();
|
||||||
|
|
||||||
|
scheduleList.forEach(landOwnerChange -> {
|
||||||
|
LandOwnerChange.CHANGE_STATUS status = landOwnerChange.getStatus();
|
||||||
|
LocalDateTime reserve_dt = landOwnerChange.getReservationDt();
|
||||||
|
int landId = landOwnerChange.getLandId();
|
||||||
|
String guid = landOwnerChange.getUserGuid();
|
||||||
|
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
if(status.equals(LandOwnerChange.CHANGE_STATUS.WAIT) && reserve_dt.isBefore(now)) {
|
||||||
|
LandRequest landRequest = LandRequest.builder()
|
||||||
|
.landId(landId)
|
||||||
|
.landName(landOwnerChange.getLandName())
|
||||||
|
.buildingId(landOwnerChange.getBuildingId())
|
||||||
|
.buildingName(landOwnerChange.getBuildingName())
|
||||||
|
.userGuid(guid)
|
||||||
|
.userName(landOwnerChange.getUserName())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
//유저킥
|
||||||
|
userGameSessionService.kickUserSession(guid, "land owner changes");
|
||||||
|
|
||||||
|
//랜드정보 처리
|
||||||
|
dynamodbLandService.ChangesLandOwner(landRequest);
|
||||||
|
|
||||||
|
Map map = new HashMap<>();
|
||||||
|
map.put("id", landOwnerChange.getId());
|
||||||
|
map.put("status", LandOwnerChange.CHANGE_STATUS.FINISH);
|
||||||
|
landService.updateLandOwnedChangeStatus(map);
|
||||||
|
|
||||||
|
//우편
|
||||||
|
dynamodbMailService.insertLandChangesMail(landRequest);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SchedulerType getSchedulerType() {
|
||||||
|
return SchedulerType.LAND_OWNER_CHANGES;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -92,12 +92,5 @@
|
|||||||
<insert id="saveLog" parameterType="map">
|
<insert id="saveLog" parameterType="map">
|
||||||
INSERT INTO admin_log (admin_id,name,mail,type,content) VALUES (#{adminId},#{name},#{mail}, #{type}, #{content});
|
INSERT INTO admin_log (admin_id,name,mail,type,content) VALUES (#{adminId},#{name},#{mail}, #{type}, #{content});
|
||||||
</insert>
|
</insert>
|
||||||
<update id="truncateMetaTable">
|
|
||||||
TRUNCATE TABLE caliverse_meta_data
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insertMetaData" parameterType="map">
|
|
||||||
INSERT INTO caliverse_meta_data (file_name, data_id, json_data) VALUES (#{fileName}, #{dataId}, #{jsonData})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -59,8 +59,10 @@
|
|||||||
LEFT JOIN admin c ON(a.create_by = c.email)
|
LEFT JOIN admin c ON(a.create_by = c.email)
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
GROUP BY a.id) d
|
GROUP BY a.id
|
||||||
|
ORDER BY a.create_dt) d
|
||||||
, (SELECT @row_number:=0) AS t
|
, (SELECT @row_number:=0) AS t
|
||||||
|
ORDER BY row_num desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getNoticeDetail" parameterType="java.lang.Long" resultMap="InGameResultMap" >
|
<select id="getNoticeDetail" parameterType="java.lang.Long" resultMap="InGameResultMap" >
|
||||||
|
|||||||
Reference in New Issue
Block a user