공지사항 front로 이동
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
<?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.core.usecase.household.updateFrontHousehold.adapters.persistence.UpdateFrontHouseholdMapper">
|
|
||||||
|
|
||||||
<update id="update">
|
|
||||||
UPDATE household
|
|
||||||
SET
|
|
||||||
owner_name = #{ownerName},
|
|
||||||
owner_age = #{ownerAge},
|
|
||||||
tel = #{tel},
|
|
||||||
phone = #{phone},
|
|
||||||
region_main_code = #{regionMainCode},
|
|
||||||
region_sub_code = #{regionSubCode},
|
|
||||||
address = #{address},
|
|
||||||
<include refid="common.fields.UpdateBaseSet" />
|
|
||||||
WHERE seq = ${seq}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,24 +1,61 @@
|
|||||||
package app.module.front.usecase.info.bankUI.getBanksUI.adapters.web;
|
package app.module.front.usecase.info.bankUI.getBanksUI.adapters.web;
|
||||||
|
|
||||||
|
import app.module.core.config.application.enums.MonthStatus;
|
||||||
import app.module.core.config.application.util.CommonUtil;
|
import app.module.core.config.application.util.CommonUtil;
|
||||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||||
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
|
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||||
|
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||||
|
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.data.web.PageableDefault;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
class GetBanksUIController {
|
class GetBanksUIController {
|
||||||
|
|
||||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
|
||||||
|
private final GetMonthlyInputStatussPortIn portIn;
|
||||||
|
|
||||||
@GetMapping(path = "/info/bank")
|
@GetMapping(path = "/info/bank")
|
||||||
String operate(Model model) {
|
String operate(Model model,
|
||||||
|
@PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable
|
||||||
|
) {
|
||||||
|
|
||||||
model.addAttribute("userInfo",
|
//TODO 사양 결정이 아직 안되 리스트 가져오는것과 오늘 날짜로 가져오는것 둘다
|
||||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
Page<GetMonthlyInputStatuss> list =
|
||||||
|
portIn.operate(
|
||||||
|
pageable,
|
||||||
|
new GetMonthlyInputStatussCmd(
|
||||||
|
null, null, AuthUtil.getUserSeq()));
|
||||||
|
|
||||||
|
model.addAttribute("list", list);
|
||||||
|
|
||||||
|
|
||||||
|
String currentMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||||
|
|
||||||
|
GetMonthlyInputStatuss matched = list.getContent().stream()
|
||||||
|
.filter(item -> currentMonth.equals(item.getMonth()))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow(() -> new NoSuchElementException("해당 월의 데이터가 없습니다."));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO 페키지명이 넘무 길어서 그냥
|
||||||
|
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||||
|
|
||||||
return "info/bank/banks";
|
return "info/bank/banks";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user