Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # front/src/main/java/app/module/front/usecase/daily/expense/adapters/persistence/DailyExpenseDao.java # front/src/main/java/app/module/front/usecase/daily/expense/adapters/persistence/DailyExpenseMapper.java # front/src/main/java/app/module/front/usecase/daily/income/adapters/persistence/DailyIncomeDao.java
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package app.module.admin.config.application.util;
|
||||
|
||||
import app.module.admin.config.application.util.model.DayRange;
|
||||
import app.module.admin.config.application.util.model.MonthOption;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@@ -30,4 +32,45 @@ public class DateUiUtil {
|
||||
public static String getCurrentMonthValue() {
|
||||
return LocalDate.now().format(VALUE_FORMAT);
|
||||
}
|
||||
|
||||
public static String getMonthValue(LocalDate date) {
|
||||
return date.format(VALUE_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자 자동 발송 대상 날짜 범위를 반환합니다.
|
||||
*
|
||||
* 발송일 기준으로 대상자 범위를 계산합니다.
|
||||
* 발송일은 매월 8일, 15일, 22일, 다음 달 1일이며,
|
||||
* 각 발송일마다 고정된 날짜 구간이 대상자 범위로 설정됩니다.
|
||||
*
|
||||
* 예시:
|
||||
* - 8일인 경우 → 1일부터 7일 까지
|
||||
* - 15일인 경우 → 8일부터 14일 까지
|
||||
* - 22일인 경우 → 15일부터 21일 까지
|
||||
* - 다음 달 1일인 경우 → 전달의 22일 부터 28,30,31일 까지
|
||||
*
|
||||
* 발송일이 아닌 경우에는 빈 Optional을 반환합니다.
|
||||
*
|
||||
* @param today 현재 날짜
|
||||
* @return DayRange 객체 또는 발송일이 아니면 Optional.empty()
|
||||
*/
|
||||
public static Optional<DayRange> getDayRange(LocalDate today) {
|
||||
int day = today.getDayOfMonth();
|
||||
|
||||
if (day == 8) {
|
||||
return Optional.of(new DayRange(1, 7));
|
||||
} else if (day == 15) {
|
||||
return Optional.of(new DayRange(8, 14));
|
||||
} else if (day == 22) {
|
||||
return Optional.of(new DayRange(15, 21));
|
||||
} else if (day == 1) {
|
||||
// 다음 달 1일 → 전달 22~말일까지
|
||||
LocalDate prevMonth = today.minusMonths(1);
|
||||
int prevLastDay = prevMonth.lengthOfMonth();
|
||||
return Optional.of(new DayRange(22, prevLastDay));
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.config.application.util.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class DayRange {
|
||||
private int fromDay;
|
||||
private int toDay;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.adapters.persistence;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatusCmd;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortOut;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetSmsAutoStatusDao implements GetSmsAutoStatusPortOut {
|
||||
private final GetSmsAutoStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public Optional<GetSmsAutoStatus> operate() {
|
||||
return mapper.operate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetSmsAutoStatusMapper {
|
||||
Optional<GetSmsAutoStatus> operate();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetSmsAutoStatusPortIn {
|
||||
Optional<GetSmsAutoStatus> operate();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetSmsAutoStatusPortOut {
|
||||
Optional<GetSmsAutoStatus> operate();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application;
|
||||
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortOut;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetSmsAutoStatusService implements GetSmsAutoStatusPortIn {
|
||||
|
||||
private final GetSmsAutoStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Optional<GetSmsAutoStatus> operate() {
|
||||
return portOut.operate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetSmsAutoStatus {
|
||||
private Boolean active;
|
||||
private String message;
|
||||
private String sendPhone;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetSmsAutoStatusCmd {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.annotation.UpdateCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.UpdateSmsAutoStatusPortOut;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class UpdateSmsAutoStatusDao implements UpdateSmsAutoStatusPortOut {
|
||||
private final UpdateSmsAutoStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
@UpdateCommand
|
||||
public void operate(UpdateSmsAutoStatusCmd cmd) {
|
||||
mapper.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UpdateSmsAutoStatusMapper {
|
||||
void operate(UpdateSmsAutoStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.UpdateSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model.UpdateSmsAutoStatusReqVO;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model.UpdateSmsAutoStatusResVO;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateSmsAutoStatusController {
|
||||
private final UpdateSmsAutoStatusPortIn portIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@PatchMapping(path = "/api/smsAutoStatus/update")
|
||||
ResponseEntity<?> operate(@Valid @RequestBody UpdateSmsAutoStatusReqVO reqVO,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
}
|
||||
|
||||
try {
|
||||
portIn.operate(new UpdateSmsAutoStatusCmd(reqVO.getActive()));
|
||||
} catch (Exception e) {
|
||||
// update 실패
|
||||
log.info(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new UpdateSmsAutoStatusResVO(
|
||||
messageUtil.getMessage("operation.common.update.done")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateSmsAutoStatusReqVO {
|
||||
private Boolean active;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateSmsAutoStatusResVO {
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
|
||||
public interface UpdateSmsAutoStatusPortIn {
|
||||
void operate(UpdateSmsAutoStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
|
||||
public interface UpdateSmsAutoStatusPortOut {
|
||||
void operate(UpdateSmsAutoStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.UpdateSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.UpdateSmsAutoStatusPortOut;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class UpdateSmsAutoStatusService implements UpdateSmsAutoStatusPortIn {
|
||||
private final UpdateSmsAutoStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(UpdateSmsAutoStatusCmd cmd) {
|
||||
portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class UpdateSmsAutoStatusCmd extends AuditCommand {
|
||||
private Boolean active;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package app.module.admin.usecase.home.adapters.web;
|
||||
|
||||
import app.module.admin.config.application.util.AdminUtil;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortIn;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import java.security.Principal;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
public class HomeController {
|
||||
|
||||
private final AdminViewPortIn adminViewPortIn;
|
||||
private final GetSmsAutoStatusPortIn getSmsAutoStatusPortIn;
|
||||
|
||||
@GetMapping
|
||||
public String home(Principal principal, Model model) {
|
||||
@@ -25,6 +28,9 @@ public class HomeController {
|
||||
model.addAttribute("loginUserRoles", loginUser.getRole());
|
||||
});
|
||||
|
||||
model.addAttribute("smsActive",
|
||||
getSmsAutoStatusPortIn.operate().orElse(null).getActive());
|
||||
|
||||
return "home";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
|
||||
List<UICodeElement> RegionSubCodeList = uiCodeListMapper.findByParentId("code.region.sub");
|
||||
List<UICodeElement> RegionDetailCodeList = uiCodeListMapper.findByLikeId("code.region.detail");
|
||||
List<UICodeElement> IndustryLargeCodeList = uiCodeListMapper.findByParentId("code.industry.large");
|
||||
List<UICodeElement> IndustryMiddleCodeList = uiCodeListMapper.findByParentId("code.industry.middle");
|
||||
List<UICodeElement> IndustryMiddleCodeList = uiCodeListMapper.findByLikeId("code.industry.middle");
|
||||
|
||||
List<String> errorList = new ArrayList<>();
|
||||
// 첫 번째 행은 헤더로 간주하고 스킵
|
||||
@@ -63,7 +63,6 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
|
||||
CheckHouseholdNum checkHouseholdNum = checkHouseholdNumMapper.checkHouseholdNum(new CheckHouseholdNumCmd(getCellValue(row.getCell(0)))).orElse(null);
|
||||
ExcelUploadContactVO contactVO = getDivisionContact(row.getCell(3));
|
||||
|
||||
// 데이터 누락 warn
|
||||
if(!checkHouseholdNum.getIsDuplicated() && contactVO != null) {
|
||||
int flag = 0;
|
||||
ExcelCreateHouseholdVO household = new ExcelCreateHouseholdVO();
|
||||
@@ -113,10 +112,6 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
|
||||
|
||||
success += flag;
|
||||
|
||||
if(flag == 0){
|
||||
errorList.add(household.getHouseholdNum());
|
||||
}
|
||||
|
||||
if(cmd.getRoleIds() != null && !cmd.getRoleIds().isEmpty()) {
|
||||
createHouseholdMapper.createHouseholdHasRole(AuditUtil.create(new CreateHouseholdHasRoleCmd(cmd.getSeq(), cmd.getRoleIds())));
|
||||
}
|
||||
@@ -124,6 +119,9 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
|
||||
if(cmd.getResearcherSeq() != null) {
|
||||
createHouseholdMapper.createResearcherHasHousehold(AuditUtil.create(new CreateResearcherHasHouseholdCmd(cmd.getSeq(), cmd.getResearcherSeq())));
|
||||
}
|
||||
} else {
|
||||
errorList.add(getCellValue(row.getCell(0)));
|
||||
log.warn("[ EXCEL 누락 ] 임가번호={} 핸드폰번호={}",getCellValue(row.getCell(0)),getCellValue(row.getCell(3)));
|
||||
}
|
||||
}
|
||||
workbook.close();
|
||||
|
||||
@@ -22,10 +22,12 @@ public class RemoveDailyDao implements RemoveDailyPortOut {
|
||||
|
||||
if (DailySort.INCOME.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyIncome(command);
|
||||
mapper.removeDailyIncomeReceipt(command);
|
||||
} else if (DailySort.WORK.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyWork(command);
|
||||
} else if (DailySort.EXPENSE.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyExpense(command);
|
||||
mapper.removeDailyExpenseReceipt(command);
|
||||
} else if (DailySort.POWER.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyPower(command);
|
||||
} else if (DailySort.FORESTRY.equals(command.getCurrentStep())) {
|
||||
|
||||
@@ -11,6 +11,12 @@ public interface RemoveDailyMapper {
|
||||
*/
|
||||
void removeDailyIncome(RemoveDailyCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 수입 영수증 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyIncomeReceipt(RemoveDailyCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 임업노동 투입 전체 삭제
|
||||
* @param command 검색 조건
|
||||
@@ -23,6 +29,12 @@ public interface RemoveDailyMapper {
|
||||
*/
|
||||
void removeDailyExpense(RemoveDailyCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 지출 영수증 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyExpenseReceipt(RemoveDailyCmd command);
|
||||
|
||||
/**
|
||||
* 동력 사용시간 전체 삭제
|
||||
* @param command 검색 조건
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortOut;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Slf4j
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class AutoSchedulesDao implements AutoSchedulesPortOut {
|
||||
@@ -26,4 +29,19 @@ class AutoSchedulesDao implements AutoSchedulesPortOut {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<Boolean> sendAutoSms(CreateSmsAutoSendCmd cmd) {
|
||||
try {
|
||||
mapper.createSmsAutoSend(cmd);
|
||||
|
||||
return Optional.of(true);
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
|
||||
// 예외 발생 시 false 반환
|
||||
return Optional.of(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AutoSchedulesMapper {
|
||||
|
||||
void createMonthlyInputStatus();
|
||||
void createSmsAutoSend(CreateSmsAutoSendCmd cmd);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.web;
|
||||
|
||||
import app.module.admin.config.application.util.DateUiUtil;
|
||||
import app.module.admin.config.application.util.model.DayRange;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
|
||||
import java.time.LocalDate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -20,6 +23,12 @@ public class AutoSchedulesController {
|
||||
portIn.operate();
|
||||
}
|
||||
|
||||
// 매일 오후 5시 마다 실행되는 스케줄러
|
||||
@Scheduled(cron = "0 0 17 * * ?")
|
||||
public void fetchSmsAutoSend() {
|
||||
portIn.sendAutoSms();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 스케쥴 있다면.. 추가.
|
||||
*/
|
||||
|
||||
@@ -5,4 +5,5 @@ import java.util.Optional;
|
||||
public interface AutoSchedulesPortIn {
|
||||
|
||||
Optional<Boolean> operate();
|
||||
Optional<Boolean> sendAutoSms();
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface AutoSchedulesPortOut {
|
||||
|
||||
Optional<Boolean> operate();
|
||||
Optional<Boolean> sendAutoSms(CreateSmsAutoSendCmd cmd);
|
||||
}
|
||||
@@ -1,20 +1,79 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports.application;
|
||||
|
||||
import app.module.admin.config.application.util.DateUiUtil;
|
||||
import app.module.admin.config.application.util.model.DayRange;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortOut;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.GetIncompleteHouseholdsPortIn;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class AutoSchedulesService implements AutoSchedulesPortIn {
|
||||
|
||||
private final AutoSchedulesPortOut portOut;
|
||||
private final GetSmsAutoStatusPortIn getSmsAutoStatusPortIn;
|
||||
private final GetIncompleteHouseholdsPortIn getIncompleteHouseholdsPortIn;
|
||||
|
||||
@Override
|
||||
public Optional<Boolean> operate() {
|
||||
return portOut.operate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<Boolean> sendAutoSms() {
|
||||
GetSmsAutoStatus getSmsAutoStatus = getSmsAutoStatusPortIn.operate().orElse(null);
|
||||
|
||||
// 문자 자동 발송 활성화 상태 체크
|
||||
if (getSmsAutoStatus == null || Boolean.FALSE.equals(getSmsAutoStatus.getActive())) {
|
||||
System.out.println("문자 발송 비활성화 상태");
|
||||
return Optional.of(false);
|
||||
}
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
int day = today.getDayOfMonth();
|
||||
|
||||
// 발송일 조건: 8일, 15일, 22일, 1일(다음 달 대상자)
|
||||
if (day == 8 || day == 15 || day == 22 || day == 1) {
|
||||
// 발송 대상 날짜 범위 구하기
|
||||
DayRange dayRange = DateUiUtil.getDayRange(today).orElse(null);
|
||||
if (dayRange == null) return Optional.of(false);
|
||||
|
||||
// 대상 월 계산 (1일 이면 이전 달 / 1일이 아니면 현재 달 yyyyMM 을 가져온다.)
|
||||
LocalDate baseDate = (day == 1) ? today.minusMonths(1) : today;
|
||||
String targetMonth = DateUiUtil.getMonthValue(baseDate);
|
||||
|
||||
// dayRange 날짜 범위의 일계부 미등록한 임가 목록 조회
|
||||
List<GetIncompleteHouseholds> incompleteHouseholds = getIncompleteHouseholdsPortIn.operate(
|
||||
new GetIncompleteHouseholdsCmd(targetMonth, dayRange.getFromDay(), dayRange.getToDay())
|
||||
);
|
||||
|
||||
// 미등록 임가가 있을 경우에만 실행
|
||||
if(!CollectionUtils.isEmpty(incompleteHouseholds)) {
|
||||
portOut.sendAutoSms(new CreateSmsAutoSendCmd(
|
||||
incompleteHouseholds,
|
||||
getSmsAutoStatus.getSendPhone(),
|
||||
getSmsAutoStatus.getMessage()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.of(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports.application.domain;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateSmsAutoSendCmd {
|
||||
private List<GetIncompleteHouseholds> sendHouseholds;
|
||||
private String sendPhone;
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.GetIncompleteHouseholdsPortOut;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetIncompleteHouseholdsDao implements GetIncompleteHouseholdsPortOut {
|
||||
private final GetIncompleteHouseholdsMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<GetIncompleteHouseholds> operate(GetIncompleteHouseholdsCmd cmd) {
|
||||
return mapper.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetIncompleteHouseholdsMapper {
|
||||
List<GetIncompleteHouseholds> operate(GetIncompleteHouseholdsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.ports;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetIncompleteHouseholdsPortIn {
|
||||
List<GetIncompleteHouseholds> operate(GetIncompleteHouseholdsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.ports;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetIncompleteHouseholdsPortOut {
|
||||
List<GetIncompleteHouseholds> operate(GetIncompleteHouseholdsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.GetIncompleteHouseholdsPortIn;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.GetIncompleteHouseholdsPortOut;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetIncompleteHouseholdsService implements GetIncompleteHouseholdsPortIn {
|
||||
private final GetIncompleteHouseholdsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public List<GetIncompleteHouseholds> operate(GetIncompleteHouseholdsCmd cmd) {
|
||||
return portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetIncompleteHouseholds {
|
||||
private Long seq;
|
||||
private String householdNum;
|
||||
private String ownerName;
|
||||
private String phone;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetIncompleteHouseholdsCmd {
|
||||
private String recordMonth;
|
||||
private int fromDay;
|
||||
private int toDay;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.dashboard.getSmsAutoStatus.adapters.persistence.GetSmsAutoStatusMapper">
|
||||
<select id="operate"
|
||||
resultType="app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus">
|
||||
/* operate : 문자 자동발송 상태 조회 */
|
||||
SELECT active,
|
||||
message,
|
||||
send_phone,
|
||||
updated_at,
|
||||
updated_by
|
||||
FROM sms_auto_status
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.persistence.UpdateSmsAutoStatusMapper" >
|
||||
<update id="operate">
|
||||
/* operate : 문자 자동 발송 활성화 상태 수정 */
|
||||
UPDATE sms_auto_status
|
||||
SET active = #{active},
|
||||
<include refid="common.fields.UpdateBaseSet" />
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -7,17 +7,21 @@
|
||||
resultType="app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordsCount.ports.application.domain.GetDailyRecordsCount">
|
||||
/* getDailyRecordsCount : 일계부 상태 요약 및 진행률 조회 */
|
||||
WITH month_check AS (
|
||||
SELECT #{recordMonth} = TO_CHAR(CURRENT_DATE, 'YYYYMM') AS is_current_month
|
||||
SELECT
|
||||
#{recordMonth} = TO_CHAR(CURRENT_DATE, 'YYYYMM') AS is_current_month,
|
||||
EXTRACT(DAY FROM (TO_DATE(#{recordMonth}, 'YYYYMM') + INTERVAL '1 MONTH - 1 day')) AS month_last_day /* recordMonth 의 말일 */
|
||||
),
|
||||
record_status AS (
|
||||
SELECT
|
||||
CASE
|
||||
/* 현재 월이고 오늘 이후인 경우만 WAITING */
|
||||
WHEN mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE) THEN 'WAITING'
|
||||
WHEN dr.all_status IN ('DONE', 'TODAY_NONE') THEN 'DONE'
|
||||
WHEN dr.all_status = 'WAITING' THEN 'INCOMPLETE'
|
||||
WHEN dr.all_status IS NULL THEN 'EMPTY'
|
||||
ELSE 'EMPTY'
|
||||
/* 현재 월이고 오늘 이후인 경우만 WAITING */
|
||||
WHEN mc.is_current_month
|
||||
AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE)
|
||||
AND ddg.start_day <= mc.month_last_day THEN 'WAITING'
|
||||
WHEN dr.all_status IN ('DONE', 'TODAY_NONE') THEN 'DONE'
|
||||
WHEN dr.all_status = 'WAITING' THEN 'INCOMPLETE'
|
||||
WHEN dr.all_status IS NULL THEN 'EMPTY'
|
||||
ELSE 'EMPTY'
|
||||
END AS all_status
|
||||
FROM daily_day_group ddg
|
||||
CROSS JOIN month_check mc
|
||||
@@ -25,8 +29,8 @@
|
||||
AND dr.household_seq = #{householdSeq}
|
||||
AND dr.record_month = #{recordMonth}
|
||||
AND dr.is_deleted = false
|
||||
WHERE ddg.start_day <= mc.month_last_day
|
||||
)
|
||||
|
||||
SELECT
|
||||
COUNT(*) FILTER (WHERE all_status = 'DONE') AS done_count,
|
||||
COUNT(*) FILTER (WHERE all_status = 'EMPTY') AS empty_count,
|
||||
|
||||
@@ -14,6 +14,19 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyIncomeReceipt">
|
||||
<if test="removeIds != null and removeIds != ''">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'INCOME'
|
||||
and receipt_type_id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyWork">
|
||||
<if test="removeIds != null and removeIds != ''">
|
||||
update daily_work set
|
||||
@@ -38,6 +51,19 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyExpenseReceipt">
|
||||
<if test="removeIds != null and removeIds != ''">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'EXPENSE'
|
||||
and receipt_type_id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyPower">
|
||||
<if test="removeIds != null and removeIds != ''">
|
||||
update daily_power set
|
||||
|
||||
@@ -6,4 +6,30 @@
|
||||
<select id="createMonthlyInputStatus">
|
||||
select fn_monthly_input_status()
|
||||
</select>
|
||||
|
||||
<insert id="createSmsAutoSend">
|
||||
/* createSmsAutoSend : 문자 발송 insert */
|
||||
INSERT INTO biz_msg
|
||||
(
|
||||
MSG_TYPE,
|
||||
CMID,
|
||||
REQUEST_TIME,
|
||||
SEND_TIME,
|
||||
DEST_PHONE,
|
||||
SEND_PHONE,
|
||||
MSG_BODY
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="sendHouseholds" item="item" separator=",">
|
||||
(
|
||||
5,
|
||||
TO_CHAR(NOW(), 'YYYYMMDDHH24MISS') || '_' || #{item.householdNum},
|
||||
NOW(),
|
||||
NOW(),
|
||||
#{item.phone},
|
||||
#{sendPhone},
|
||||
#{message}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.schedule.getIncompleteHouseholds.adapters.persistence.GetIncompleteHouseholdsMapper">
|
||||
<select id="operate"
|
||||
resultType="app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds">
|
||||
/* operate : 문자 발송 일계부 미완료된 대상자 조회 */
|
||||
SELECT h.seq,
|
||||
h.household_num,
|
||||
h.owner_name,
|
||||
h.phone
|
||||
FROM household h
|
||||
WHERE h.seq IN (
|
||||
SELECT DISTINCT dr.household_seq
|
||||
FROM daily_record dr
|
||||
WHERE dr.record_month = #{recordMonth}
|
||||
AND dr.day_group_no IN (
|
||||
SELECT ddg.group_no
|
||||
FROM daily_day_group ddg
|
||||
WHERE ddg.is_deleted = false
|
||||
AND ddg.start_day >= #{fromDay}
|
||||
AND ddg.end_day < #{toDay}
|
||||
)
|
||||
AND dr.all_status NOT IN ('DONE', 'TODAY_NONE')
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
File diff suppressed because one or more lines are too long
@@ -94,7 +94,7 @@
|
||||
<a aria-current="page" th:href="${topNode.uri}" >
|
||||
<img class="logo" th:src="@{/static/assets/images/common/ico_logo.svg}" alt="로고 이미지">
|
||||
</a>
|
||||
<p class="logo-tit">임가경제조사 일계부 관리자모드</p>
|
||||
<p class="logo-tit"><a th:href="${topNode.uri}">임가경제조사 일계부 관리자모드</a></p>
|
||||
</div>
|
||||
<ul class="main-menu" th:if="${topNode != null}">
|
||||
<li class="menu-item" th:each="menu : ${topNode.children}"
|
||||
|
||||
@@ -1,35 +1,895 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout-home}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
<html layout:decorate="~{layout/layout-home}"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<title>관리자 수정</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<section layout:fragment="content">
|
||||
<div class="content-inner">
|
||||
<!-- s: 2025.07.08 필터셀렉트 추가 -->
|
||||
<div class="d-flex-tit">
|
||||
<hgroup class="page-tit-group">
|
||||
<h2 class="page-tit">
|
||||
2025년 6월 현황
|
||||
</h2>
|
||||
</hgroup>
|
||||
<div class="filter-group">
|
||||
<div class="component-select">
|
||||
<select class="select-list" required>
|
||||
<option value="" disabled hidden>선택해주세요.</option>
|
||||
<option value="value1" selected>전체</option>
|
||||
<option value="value2">Option 2</option>
|
||||
<option value="value3">Option 3</option>
|
||||
<option value="value4">Option 4</option>
|
||||
<option value="value5">Option 5</option>
|
||||
<option value="value6">Option 6</option>
|
||||
<option value="value7">Option 7</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- e: 2025.07.08 필터셀렉트 추가 -->
|
||||
<section class="dounut-chart-area">
|
||||
<div class="chart-group type-green">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">50</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 50;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 mb-4 bg-light rounded-3">
|
||||
<div class="container-fluid py-5">
|
||||
<h1 class="display-5 fw-bold">안녕하세요, <span class="text-muted"
|
||||
sec:authentication="name"></span> :-)</h1>
|
||||
<p class="col-md-8 fs-4">
|
||||
관리자 메인에 오신걸 환영합니다. <span class="text-muted" sec:authentication="name"></span> 님께 부여된 역할에 따라
|
||||
메뉴이용이
|
||||
제한되는 점에 유의해주세요.
|
||||
</p>
|
||||
<div class="chart-group type-blue">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">68</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 68;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chart-group type-orange">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">48</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 48;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<div class="table-group">
|
||||
<div class="table-tit-group large">
|
||||
<h3>
|
||||
지방실사별 진행현황
|
||||
</h3>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
실사
|
||||
</th>
|
||||
<th>임계부 진행률</th>
|
||||
<th>현장 방문률(1차)</th>
|
||||
<th>답례품 전달률</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>서울</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>강원</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="35" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">35</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="55" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">55</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="total">
|
||||
<td>전체</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-group">
|
||||
<div class="table-tit-group large">
|
||||
<h3>
|
||||
조사원별 진행 현황
|
||||
</h3>
|
||||
<div class="component-select">
|
||||
<select class="select-list" required>
|
||||
<option value="" disabled hidden>선택해주세요.</option>
|
||||
<option value="value1" selected>전체</option>
|
||||
<option value="value2">Option 2</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 테이블 스크롤 클래스 추가 "table-scroll-wrap" -->
|
||||
<div class="table-scroll-wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="8%" />
|
||||
<col width="8%" />
|
||||
<col width="8%" />
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>조사원명</th>
|
||||
<th>실사</th>
|
||||
<th>할당 임가 수</th>
|
||||
<th>임계부 진행률</th>
|
||||
<th>현장 방문률(1차)</th>
|
||||
<th>답례품 전달률</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="component-input sms-check" th:if="${loginUserRoles.id == 'ROLE_ADMIN'}">
|
||||
<label class="switch-inner">
|
||||
<span class="switch-label">문자 자동 발송 여부</span>
|
||||
<input type="checkbox" id="smsAutoSend" name="temp_switch_0100" th:checked="${smsActive}"
|
||||
onclick="smsAutoSendConfirm(this);">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p class="col-md-8 fs-5">
|
||||
<span>역할</span>
|
||||
<span class="text-muted"
|
||||
th:each="role, status : ${loginUserRoles}"
|
||||
th:text="${role.getId()} + ' (' + ${role.description} + ')' + ${!status.last ? ', ': ''}"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
/**
|
||||
* 문자 발송 체크 스크립트
|
||||
* */
|
||||
|
||||
// 문자 자동 발송 컨펌창
|
||||
const smsAutoSendConfirm = (el) => {
|
||||
let message = el.checked ? '문자 자동 발송 기능을 사용하시겠습니까?' : '문자 자동 발송 기능을 중지하시겠습니까?';
|
||||
|
||||
etUI.dialog.confirm({
|
||||
title: '문자 자동 발송 안내',
|
||||
message: message,
|
||||
negativeCallback: function () {
|
||||
$(el).prop('checked', !el.checked);
|
||||
},
|
||||
positiveCallback: function () {
|
||||
updateSmsAutoStatusActive(el.checked);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 문자 자동 발송 기능 활성화
|
||||
const updateSmsAutoStatusActive = (active) => {
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/smsAutoStatus/update',
|
||||
JSON.stringify({
|
||||
active: active,
|
||||
}),
|
||||
() => {
|
||||
$('#smsAutoSend').prop('checked', active);
|
||||
},
|
||||
(code, rstData) => {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
$('#smsAutoSend').prop('checked', !active);
|
||||
},
|
||||
'patch',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -4,23 +4,26 @@
|
||||
<head th:replace="~{common/components :: head}"></head>
|
||||
|
||||
<body>
|
||||
<header th:replace="~{common/components :: header}"></header>
|
||||
<div id="wrap">
|
||||
<header th:replace="~{common/components :: header}"></header>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="content" role="main">
|
||||
<div class="inner">
|
||||
<div class="content-inner">
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
<div style="display: flex; justify-content: space-evenly;align-items: center; width:100%; background: #DEE2E6; height: 500px; font-size: 16px;">
|
||||
<section class="container" layout:fragment="content">
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
<div class="content-inner">
|
||||
<section layout:fragment="content">
|
||||
page content
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:replace="~{common/components :: footer}"></div>
|
||||
|
||||
<section layout:fragment="script"></section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package app.module.core.config.application.util;
|
||||
|
||||
import app.module.core.usecase.file.getFile.adapters.persistence.GetFileMapper;
|
||||
import app.module.core.usecase.file.getFile.ports.application.domain.GetFile;
|
||||
import app.module.core.usecase.file.saveToStorage.ports.application.strategy.SftpConnector;
|
||||
import app.module.core.usecase.file.updateFile.adapters.persistence.UpdateFileMapper;
|
||||
import app.module.core.usecase.file.updateFile.ports.application.domain.UploadFileDto;
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
@@ -18,6 +21,8 @@ import java.nio.file.Paths;
|
||||
public class SftpFileDeleteUtil {
|
||||
|
||||
private final SftpConnector sftpConnector;
|
||||
private final GetFileMapper getFileMapper;
|
||||
private final UpdateFileMapper updateFileMapper;
|
||||
|
||||
@Value("${path.upload.sftp.public}")
|
||||
private String publicPath;
|
||||
@@ -64,6 +69,47 @@ public class SftpFileDeleteUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteRealFile(Long deleteFileId) throws JSchException, SftpException {
|
||||
GetFile deleteFile = getFileMapper.findById(deleteFileId).orElseThrow();
|
||||
updateFileMapper.deleteReceiptFile(deleteFileId,CommonUtil.getLoginUsername());
|
||||
|
||||
if (deleteFile == null || deleteFile.getPath() == null || deleteFile.getName() == null) {
|
||||
log.error("Invalid file information: {}", deleteFile);
|
||||
throw new IllegalArgumentException("Invalid file information");
|
||||
}
|
||||
|
||||
// 경로 검증 및 생성
|
||||
String filePath = constructSafeFilePath(deleteFile.getPath(), deleteFile.getName());
|
||||
log.info("Attempting to delete file from SFTP: {}", filePath);
|
||||
|
||||
// SFTP 연결 확인 및 재연결
|
||||
if (!sftpConnector.isConnected()) {
|
||||
log.warn("SFTP connection lost, attempting to reconnect");
|
||||
sftpConnector.connect();
|
||||
}
|
||||
ChannelSftp channelSftp = sftpConnector.getChannelSftp();
|
||||
if (channelSftp == null) {
|
||||
log.error("SFTP channel is not initialized");
|
||||
throw new SftpException(ChannelSftp.SSH_FX_NO_CONNECTION, "SFTP channel is not initialized");
|
||||
}
|
||||
|
||||
// 파일 삭제
|
||||
try {
|
||||
channelSftp.stat(filePath); // 파일 존재 여부 확인
|
||||
channelSftp.rm(filePath);
|
||||
log.info("File deleted successfully from SFTP: {}", filePath);
|
||||
} catch (SftpException e) {
|
||||
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
|
||||
log.warn("File does not exist on SFTP: {}", filePath);
|
||||
} else {
|
||||
log.error("Failed to delete file from SFTP: {}, error: {}", filePath, e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 경로 조작 방지를 위해 안전한 파일 경로 생성
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.core.usecase.file.updateFile.adapters.persistence;
|
||||
import app.module.core.usecase.file.updateFile.ports.application.domain.UpdateUploadFileParam;
|
||||
import app.module.core.usecase.file.updateFile.ports.application.domain.UploadFileDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -10,5 +11,6 @@ import java.util.List;
|
||||
public interface UpdateFileMapper {
|
||||
List<UploadFileDto> findDeleteFileList(UpdateUploadFileParam uploadFile);
|
||||
void deleteFile(UpdateUploadFileParam uploadFile);
|
||||
void deleteReceiptFile(@Param("fileId") Long fileId,@Param("deletedUserId") String deletedUserId);
|
||||
void updateFile(UploadFileDto uploadFile);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
type,
|
||||
file_length,
|
||||
ocr,
|
||||
daily_record_seq,
|
||||
mapping_id,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) VALUES(
|
||||
#{id},
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="deleteReceiptFile">
|
||||
UPDATE upload_file
|
||||
SET deleted_by = #{deletedUserId},
|
||||
deleted_at = now(),
|
||||
is_deleted = true
|
||||
WHERE is_deleted = false
|
||||
and id = #{fileId}
|
||||
</update>
|
||||
|
||||
<update id="updateFile" >
|
||||
UPDATE upload_file
|
||||
SET mapping_id = #{mappingId},
|
||||
|
||||
@@ -1904,4 +1904,26 @@ COMMENT ON COLUMN address.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN address.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN address.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN address.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN address.is_deleted IS '삭제여부';
|
||||
COMMENT ON COLUMN address.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TABLE : sms_auto_send
|
||||
-- DESC : 문자 자동 발송 활성화 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE sms_auto_status (
|
||||
active boolean NOT null,
|
||||
message text,
|
||||
send_phone varchar(255),
|
||||
updated_at timestamp(6),
|
||||
updated_by varchar(255)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE sms_auto_status IS '문자 자동 발송 활성화 테이블';
|
||||
|
||||
COMMENT ON COLUMN sms_auto_status.active IS '자동 발송 기능 ON/OFF 여부';
|
||||
COMMENT ON COLUMN sms_auto_status.message IS '메세지';
|
||||
COMMENT ON COLUMN sms_auto_status.send_phone IS '발송번호';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_by IS '수정자';
|
||||
@@ -1,12 +1,18 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.config.application.util.SftpFileDeleteUtil;
|
||||
import app.module.core.usecase.file.updateFile.adapters.persistence.UpdateFileMapper;
|
||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
||||
import app.module.front.usecase.daily.expense.ports.DailyExpensePortOut;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@@ -46,6 +52,7 @@ public class DailyExpenseDao implements DailyExpensePortOut {
|
||||
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||
if (existCount != 0) {
|
||||
mapper.removeDailyExpense(command);
|
||||
mapper.removeDailyExpenseReceipt(command);
|
||||
|
||||
log.debug("[RemoveDailyExpense] record={}", command);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -57,4 +54,11 @@ public interface DailyExpenseMapper {
|
||||
* @param command 삭제 데이터
|
||||
*/
|
||||
void removeDailyExpense(RemoveDailyExpenseCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 지출 영수증 삭제
|
||||
*
|
||||
* @param command 삭제 데이터
|
||||
*/
|
||||
void removeDailyExpenseReceipt(RemoveDailyExpenseCmd command);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class DailyIncomeDao implements DailyIncomePortOut {
|
||||
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||
if (existCount != 0) {
|
||||
mapper.removeDailyIncome(command);
|
||||
mapper.removeDailyIncomeReceipt(command);
|
||||
|
||||
log.debug("[RemoveDailyIncome] record={}", command);
|
||||
}
|
||||
|
||||
@@ -54,4 +54,11 @@ public interface DailyIncomeMapper {
|
||||
* @param command 삭제 데이터
|
||||
*/
|
||||
void removeDailyIncome(RemoveDailyIncomeCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 수입 영수증 삭제
|
||||
*
|
||||
* @param command 삭제 데이터
|
||||
*/
|
||||
void removeDailyIncomeReceipt(RemoveDailyIncomeCmd command);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.receipt.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.annotation.CreateCommand;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.usecase.daily.receipt.adapters.web.model.CreateReceiptHasFileReqVO;
|
||||
import app.module.front.usecase.daily.receipt.ports.DailyReceiptPortOut;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -22,4 +23,10 @@ public class DailyReceiptDao implements DailyReceiptPortOut {
|
||||
public void insertReceiptMappingFile(CreateReceiptHasFileReqVO command) {
|
||||
dailyReceiptMapper.insertReceiptMappingFile(command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectReceiptCount(String inputType) {
|
||||
|
||||
return dailyReceiptMapper.selectReceiptCount(inputType, CommonUtil.getLoginUsername());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.receipt.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.daily.receipt.adapters.web.model.CreateReceiptHasFileReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
@Mapper
|
||||
@@ -16,4 +17,13 @@ public interface DailyReceiptMapper {
|
||||
*/
|
||||
Integer insertReceiptMappingFile(CreateReceiptHasFileReqVO command);
|
||||
|
||||
/**
|
||||
* 일계부 수입 파일 매핑
|
||||
*
|
||||
* @param inputType 수입/지출
|
||||
* @param userId 사용자 아이디
|
||||
* @return 중복 개수
|
||||
*/
|
||||
Integer selectReceiptCount(@Param("inputType") String inputType,@Param("userId")String userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpe
|
||||
import app.module.front.usecase.daily.expense.ports.DailyExpensePortIn;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.RemoveDailyIncomeReqVO;
|
||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||
import app.module.front.usecase.daily.receipt.adapters.web.model.*;
|
||||
import app.module.front.usecase.daily.receipt.ports.DailyReceiptPortIn;
|
||||
@@ -25,7 +26,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.HttpClientErrorException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
@@ -105,7 +105,7 @@ public class DailyReceiptController {
|
||||
|
||||
|
||||
/**
|
||||
* 일계부 영수증 수입 등록 처리
|
||||
* 일계부 영수증 수입/수출 등록 처리
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
@@ -196,6 +196,15 @@ public class DailyReceiptController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 영수증 개수 확인
|
||||
*
|
||||
*/
|
||||
@GetMapping(path = "/{inputType}/count")
|
||||
ResponseEntity<?> receiptCount(@PathVariable("inputType") String inputType) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body( dailyReceiptPortIn.selectReceiptCount(inputType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 유효성 체크 및 데이터 조회
|
||||
*
|
||||
|
||||
@@ -6,9 +6,15 @@ import app.module.front.usecase.daily.receipt.adapters.web.model.CreateReceiptHa
|
||||
public interface DailyReceiptPortIn {
|
||||
|
||||
/**
|
||||
* 일계부 수입 파일 매핑 추가
|
||||
* 일계부 영수증 파일 매핑 추가
|
||||
*
|
||||
*/
|
||||
void insertReceiptMappingFile(CreateReceiptHasFileReqVO formVO);
|
||||
|
||||
/**
|
||||
* 일계부 영수증 파일 개수
|
||||
*
|
||||
*/
|
||||
Integer selectReceiptCount(String inputType);
|
||||
|
||||
}
|
||||
|
||||
@@ -12,4 +12,12 @@ public interface DailyReceiptPortOut {
|
||||
* @param command 수입 영수증 매핑 검색 조건
|
||||
*/
|
||||
void insertReceiptMappingFile(CreateReceiptHasFileReqVO command);
|
||||
|
||||
/**
|
||||
* 일계부 수입 영수증 매핑
|
||||
*
|
||||
|
||||
* @param inputType 수출/수입
|
||||
*/
|
||||
Integer selectReceiptCount(String inputType);
|
||||
}
|
||||
|
||||
@@ -16,4 +16,11 @@ public class DailyReceiptService implements DailyReceiptPortIn {
|
||||
public void insertReceiptMappingFile(CreateReceiptHasFileReqVO formVO) {
|
||||
portOut.insertReceiptMappingFile(formVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectReceiptCount(String inputType) {
|
||||
return portOut.selectReceiptCount(inputType);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -82,4 +82,14 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="removeDailyExpenseReceipt">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'EXPENSE'
|
||||
<if test="id != null and id != ''">
|
||||
and receipt_type_id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -83,4 +83,14 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="removeDailyIncomeReceipt">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'INCOME'
|
||||
<if test="id != null and id != ''">
|
||||
and receipt_type_id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -17,4 +17,12 @@
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectReceiptCount">
|
||||
select count(*)
|
||||
from receipt_has_record
|
||||
where created_by = #{userId}
|
||||
and created_at = CURRENT_DATE
|
||||
and type = #{inputType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -330,6 +330,5 @@ var ajaxUtil = {
|
||||
ajaxUtil.loadingStatus = true;
|
||||
// TODO : 로딩바 활성화
|
||||
document.querySelector('#loadingBar').style.display = 'block';
|
||||
debugger
|
||||
},
|
||||
};
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(true)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(true)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(false)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
<!--/* 영수증 등록 s */-->
|
||||
<div id="modelOcr" style="display: none;">
|
||||
<section class="form-group">
|
||||
<input type="hidden" id="countOcr"/>
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
영수증 첨부
|
||||
|
||||
@@ -248,10 +248,35 @@
|
||||
$('#modelOcr').hide();
|
||||
$('#btnOcr').removeClass('active');
|
||||
} else {
|
||||
$('#modelSelf').hide();
|
||||
$('#btnSelf').removeClass('active');
|
||||
$('#modelOcr').show();
|
||||
$('#btnOcr').addClass('active');
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
'/api/record/receipt/INCOME/count',
|
||||
{},
|
||||
(response) => { // 성공
|
||||
if(response < 3) {
|
||||
$('#modelSelf').hide();
|
||||
$('#btnSelf').removeClass('active');
|
||||
$('#modelOcr').show();
|
||||
$('#btnOcr').addClass('active');
|
||||
$('#countOcr').val(response);
|
||||
}else{
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: '영수증은 일일 최대 3개 등록 가능합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
function (code, rstData) { // 실패
|
||||
console.log("error : ", code);
|
||||
},
|
||||
'get',
|
||||
'json'
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
createVaild() {
|
||||
@@ -272,14 +297,25 @@
|
||||
);
|
||||
},
|
||||
addFileInput() {
|
||||
// 새로운 input type="file" 요소 생성
|
||||
const countOcr = $('#countOcr').val();
|
||||
if(uploadedReceipt.length === 3 - countOcr ){
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: '영수증은 일일 최대 3개 등록 가능합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
fileInput.accept = 'image/*';
|
||||
fileInput.style.display = 'none';
|
||||
fileInput.name = 'file';
|
||||
|
||||
// 파일 선택 시 이벤트 처리
|
||||
// 파일 선택
|
||||
fileInput.addEventListener('change', (event) => {
|
||||
const files = event.target.files;
|
||||
const previewContainer = $('#file-upload-container');
|
||||
@@ -330,7 +366,6 @@
|
||||
`);
|
||||
previewContainer.append(fileItem);
|
||||
|
||||
// 파일 정보와 서버 응답 저장
|
||||
uploadedReceipt.push({
|
||||
fileId: fileItemId,
|
||||
file: file,
|
||||
@@ -383,8 +418,8 @@
|
||||
const receiptDataList = uploadedReceipt;
|
||||
if (!receiptDataList.length) {
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '등록할 영수증 데이터가 없습니다.',
|
||||
title: '',
|
||||
message: '최소 1개의 영수증을 등록해주셔야 합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user