Merge branch 'dev' into 'deploy-dev-front'
Dev See merge request korea-research/korea-research!95
This commit is contained in:
@@ -6,4 +6,34 @@ logging:
|
||||
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
|
||||
level:
|
||||
app:
|
||||
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
|
||||
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
|
||||
|
||||
# ==============================================
|
||||
# 메시지 및 국제화(i18n) 설정
|
||||
# ==============================================
|
||||
spring:
|
||||
messages:
|
||||
# 메시지 소스 캐시 지속 시간(초)
|
||||
# 4초마다 메시지 파일을 다시 읽어옵니다
|
||||
# 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적
|
||||
cache-duration: 10s
|
||||
thymeleaf:
|
||||
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
|
||||
cache: false
|
||||
# ==============================================
|
||||
# 데이터베이스 설정
|
||||
# ==============================================
|
||||
datasource:
|
||||
kri:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
|
||||
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
|
||||
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
|
||||
|
||||
# ==============================================
|
||||
# 암호화 설정
|
||||
# ==============================================
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: etribe
|
||||
algorithm: PBEWITHHMACSHA512ANDAES_256
|
||||
@@ -6,4 +6,21 @@ logging:
|
||||
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
|
||||
level:
|
||||
app:
|
||||
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
|
||||
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
|
||||
# ==============================================
|
||||
# 메시지 및 다국어 처리 설정
|
||||
# ==============================================
|
||||
spring:
|
||||
datasource:
|
||||
kri:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
|
||||
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
|
||||
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
|
||||
# ==============================================
|
||||
# 암호화 설정
|
||||
# ==============================================
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: etribe
|
||||
algorithm: PBEWITHHMACSHA512ANDAES_256
|
||||
@@ -8,7 +8,26 @@ logging:
|
||||
app:
|
||||
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
|
||||
|
||||
|
||||
# ==============================================
|
||||
# 메시지 및 국제화(i18n) 설정
|
||||
# ==============================================
|
||||
spring:
|
||||
messages:
|
||||
# 메시지 소스 캐시 지속 시간 (단위: 초)
|
||||
# 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장
|
||||
cache-duration: 5m
|
||||
thymeleaf:
|
||||
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
|
||||
cache: false
|
||||
# ==============================================
|
||||
# 데이터베이스 설정
|
||||
# ==============================================
|
||||
datasource:
|
||||
kri:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
jdbc-url: ENC(mF3Z0fgCagFruOk/F2Z2PYzXhwGedE1secfYDgci+ke9z8xFEZ/GWbgXA4XeSq5D+k9/oRLOxzwx/D24tswdoHdQugHmGb0UqrW4vGBa7YFJvcnWylOpd5ppUeEIUJGv)
|
||||
username: ENC(cNXntROGOeM115QfLlVhhBz8+qY70eTWwmwLM+7AMslWmfWTq9ZPl4pVnDopJauM)
|
||||
password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI)
|
||||
|
||||
# ==============================================
|
||||
# 서버 압축 설정
|
||||
|
||||
@@ -10,6 +10,17 @@ spring:
|
||||
enabled: true
|
||||
mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript
|
||||
min-response-size: 2048
|
||||
# ==============================================
|
||||
# 데이터베이스 설정
|
||||
# ==============================================
|
||||
datasource:
|
||||
hikari:
|
||||
maximum-pool-size: 10
|
||||
minimum-idle: 5
|
||||
idle-timeout: 120000
|
||||
max-lifetime: 900000
|
||||
connection-timeout: 5000
|
||||
leak-detection-threshold: 30000
|
||||
|
||||
# 정적 자원 캐싱 설정
|
||||
web:
|
||||
@@ -92,6 +103,14 @@ logging:
|
||||
jdbc:
|
||||
bind: trace # Hibernate SQL 파라미터 바인딩 로깅
|
||||
# ==============================================
|
||||
# MyBatis 설정
|
||||
# ==============================================
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
kri: classpath*:mappers/**/*Mapper.xml # 매퍼 파일 위치
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체
|
||||
# ==============================================
|
||||
# 서버 압축 설정
|
||||
# ==============================================
|
||||
server:
|
||||
|
||||
@@ -17,6 +17,19 @@
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyExpenseMonthList"
|
||||
resultType="app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto">
|
||||
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||
, ds.expense_kind, ds.source_purpose
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_expense ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_expense ds
|
||||
@@ -69,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>
|
||||
|
||||
@@ -14,7 +14,20 @@
|
||||
and ds.id = #{id}
|
||||
</if>
|
||||
order by
|
||||
ds.id desc
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyFarmingMonthList"
|
||||
resultType="app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.product_code, ds.product_self, ds.usage
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.estimated_value
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_farming ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
|
||||
@@ -14,7 +14,20 @@
|
||||
and ds.id = #{id}
|
||||
</if>
|
||||
order by
|
||||
ds.id desc
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyForestryMonthList"
|
||||
resultType="app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.product_name, ds.usage
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.estimated_value
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_forestry ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
|
||||
@@ -17,6 +17,19 @@
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyIncomeMonthList"
|
||||
resultType="app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto">
|
||||
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||
, ds.crop_code, ds.income_kind, ds.source_purpose
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_income ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_income ds
|
||||
@@ -70,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>
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyPowerMonthList"
|
||||
resultType="app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.equipment_name, ds.owned_hours, ds.leased_hours
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_power ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_power ds
|
||||
|
||||
@@ -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.front.usecase.daily.receipt.adapters.persistence.DailyReceiptMapper">
|
||||
|
||||
|
||||
<insert id="insertReceiptMappingFile" >
|
||||
insert into receipt_has_record(
|
||||
receipt_type_id,
|
||||
file_id,
|
||||
"type",
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{receiptId},
|
||||
#{fileId},
|
||||
#{type},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectReceiptCount">
|
||||
select count(*)
|
||||
from receipt_has_record
|
||||
where created_by = #{userId}
|
||||
and created_at = CURRENT_DATE
|
||||
and type = #{inputType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
152
front/src/main/resources/mappers/daily/DailyStatusMapper.xml
Normal file
152
front/src/main/resources/mappers/daily/DailyStatusMapper.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?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.front.usecase.daily.status.adapters.persistence.DailyStatusMapper">
|
||||
|
||||
<select id="getDailyStatusByMonth"
|
||||
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto">
|
||||
<![CDATA[
|
||||
with day_gorup as (
|
||||
select only_day.day, ddg.group_no
|
||||
from (SELECT generate_series(1, 31) as day) as only_day
|
||||
left join
|
||||
daily_day_group ddg on ddg.start_day <= only_day."day" and ddg.end_day >= only_day."day" and ddg.is_deleted = false
|
||||
where only_day.day <= DATE_PART('day', (date_trunc('MONTH', TO_DATE(#{recordMonth}, 'YYYYMM')) + INTERVAL '1 MONTH - 1 day'))
|
||||
)
|
||||
select count(dg.day) as day_count
|
||||
, (count(dg.day) filter (where dr.all_status = 'DONE')) as done_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_record dr on dr.day_group_no = dg.group_no and dr.record_month = to_char(TO_DATE(#{recordMonth}, 'YYYYMM'), 'YYYYMM') and dr.household_seq = #{householdSeq}
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="getDailyStatusByItemCount"
|
||||
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto">
|
||||
<![CDATA[
|
||||
with day_gorup as (
|
||||
select only_day.day, ddg.group_no, dr.id as daily_record_seq
|
||||
, dr.all_status, dr.income_status, dr.work_status, dr.expense_status, dr.power_status, dr.forestry_status, dr.farming_status
|
||||
from (SELECT generate_series(1, 31) as day) as only_day
|
||||
left join
|
||||
daily_day_group ddg on ddg.start_day <= only_day."day" and ddg.end_day >= only_day."day" and ddg.is_deleted = false
|
||||
left join
|
||||
daily_record dr on dr.record_month = #{recordMonth} and dr.household_seq = #{householdSeq} and dr.day_group_no = ddg.group_no and dr.is_deleted = false
|
||||
where only_day.day <= DATE_PART('day', (date_trunc('MONTH', TO_DATE(#{recordMonth}, 'YYYYMM')) + INTERVAL '1 MONTH - 1 day'))
|
||||
)
|
||||
select 'INCOME' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.income_status = 'TARGET' and di.id is not null) or dg.income_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct di.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_income di on di.daily_record_seq = dg.daily_record_seq and di.is_deleted = false
|
||||
union all
|
||||
select 'WORK' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.work_status = 'TARGET' and dw.id is not null) or dg.work_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct dw.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_work dw on dw.daily_record_seq = dg.daily_record_seq and dw.is_deleted = false
|
||||
union all
|
||||
select 'EXPENSE' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.expense_status = 'TARGET' and de.id is not null) or dg.expense_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct de.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_expense de on de.daily_record_seq = dg.daily_record_seq and de.is_deleted = false
|
||||
union all
|
||||
select 'POWER' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.power_status = 'TARGET' and dp.id is not null) or dg.power_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct dp.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_power dp on dp.daily_record_seq = dg.daily_record_seq and dp.is_deleted = false
|
||||
union all
|
||||
select 'FORESTRY' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.forestry_status = 'TARGET' and df1.id is not null) or dg.forestry_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct df1.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_forestry df1 on df1.daily_record_seq = dg.daily_record_seq and df1.is_deleted = false
|
||||
union all
|
||||
select 'FARMING' as step
|
||||
, count(distinct dg.day) as day_count
|
||||
, count(distinct dg.day) filter (where (dg.farming_status = 'TARGET' and df2.id is not null) or dg.farming_status = 'TODAY_NONE') as done_count
|
||||
, count(distinct df2.id) as input_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_farming df2 on df2.daily_record_seq = dg.daily_record_seq and df2.is_deleted = false
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="getDailyStatusByItemValue"
|
||||
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto">
|
||||
<![CDATA[
|
||||
with r_daily_record as (
|
||||
select dr.id from daily_record dr where dr.record_month = #{recordMonth} and dr.household_seq = #{householdSeq} and dr.is_deleted = false
|
||||
)
|
||||
select 'INCOME' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(di.price, 0) + COALESCE(di.estimated_value, 0)
|
||||
), 0) as total_value
|
||||
from daily_income di
|
||||
inner join
|
||||
r_daily_record dr on dr.id = di.daily_record_seq
|
||||
where di.is_deleted = false
|
||||
union all
|
||||
select 'EXPENSE' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(de.price, 0) + COALESCE(de.estimated_value, 0)
|
||||
), 0) as total_value
|
||||
from daily_expense de
|
||||
inner join
|
||||
r_daily_record dr on dr.id = de.daily_record_seq
|
||||
where de.is_deleted = false
|
||||
union all
|
||||
select 'WORK' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(cast(dw.owner_time as numeric), 0) + COALESCE(cast(dw.spouse_time as numeric), 0)
|
||||
+ COALESCE(cast(dw.family_f_hours as numeric), 0) + COALESCE(cast(dw.family_m_hours as numeric), 0)
|
||||
+ COALESCE(cast(dw.hired_m_hours as numeric), 0) + COALESCE(cast(dw.hired_f_hours as numeric), 0)
|
||||
+ COALESCE(cast(dw.shared_m_hours as numeric), 0) + COALESCE(cast(dw.shared_f_hours as numeric), 0)
|
||||
+ COALESCE(cast(dw.volunteer_m_hours as numeric), 0) + COALESCE(cast(dw.volunteer_f_hours as numeric), 0)
|
||||
), 0) as total_value
|
||||
from daily_work dw
|
||||
inner join
|
||||
r_daily_record dr on dr.id = dw.daily_record_seq
|
||||
where dw.is_deleted = false
|
||||
union all
|
||||
select 'POWER' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(cast(dp.owned_hours as numeric), 0) + COALESCE(cast(dp.leased_hours as numeric), 0)
|
||||
), 0) as total_value
|
||||
from daily_power dp
|
||||
inner join
|
||||
r_daily_record dr on dr.id = dp.daily_record_seq
|
||||
where dp.is_deleted = false
|
||||
union all
|
||||
select 'FORESTRY' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(df1.estimated_value, 0)
|
||||
), 0) as total_value
|
||||
from daily_forestry df1
|
||||
inner join
|
||||
r_daily_record dr on dr.id = df1.daily_record_seq
|
||||
where df1.is_deleted = false
|
||||
union all
|
||||
select 'FARMING' as step
|
||||
, COALESCE(sum(
|
||||
COALESCE(df2.estimated_value, 0)
|
||||
), 0) as total_value
|
||||
from daily_farming df2
|
||||
inner join
|
||||
r_daily_record dr on dr.id = df2.daily_record_seq
|
||||
where df2.is_deleted = false
|
||||
]]>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -9,7 +9,6 @@
|
||||
, ds.work_land_area, ds.area_unit_code, ds.area_unit_self, ds.harvest_quantity, ds.harvest_unit_code, ds.harvest_unit_self
|
||||
, ds.owner_time, ds.spouse_time, ds.family_m_hours, ds.family_f_hours, ds.hired_m_hours
|
||||
, ds.hired_f_hours, ds.shared_m_hours, ds.shared_f_hours, ds.volunteer_m_hours, ds.volunteer_f_hours
|
||||
, ds.is_deleted
|
||||
from daily_work ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
@@ -20,6 +19,21 @@
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getDailyWorkMonthList"
|
||||
resultType="app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.item_name, ds.work_name
|
||||
, ds.work_land_area, ds.area_unit_code, ds.area_unit_self, ds.harvest_quantity, ds.harvest_unit_code, ds.harvest_unit_self
|
||||
, ds.owner_time, ds.spouse_time, ds.family_m_hours, ds.family_f_hours, ds.hired_m_hours
|
||||
, ds.hired_f_hours, ds.shared_m_hours, ds.shared_f_hours, ds.volunteer_m_hours, ds.volunteer_f_hours
|
||||
, dr.start_date, dr.end_date, ddg.group_no
|
||||
from daily_work ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||
where ds.is_deleted = false
|
||||
order by
|
||||
ddg.group_no, ds.id
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_work ds
|
||||
|
||||
@@ -16,6 +16,16 @@
|
||||
ddg.group_no asc
|
||||
</select>
|
||||
|
||||
<select id="getMonthlyCarryOver">
|
||||
select ds.carry_over
|
||||
from daily_summary ds
|
||||
where ds.household_seq = #{householdSeq}
|
||||
and ds.record_month = #{searchMonth}
|
||||
order by
|
||||
ds.id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getMonthlyStatus">
|
||||
select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output
|
||||
from monthly_input_status mis
|
||||
@@ -29,58 +39,14 @@
|
||||
|
||||
<select id="getDataNoneCountBySomeDayAfter">
|
||||
<![CDATA[
|
||||
with temp_day_group as (
|
||||
select group_no, start_day, end_day
|
||||
, DATE_PART('day', CURRENT_DATE - INTERVAL '3 days') as current_day
|
||||
, DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') as prev_day
|
||||
, DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days') as prev_last_day
|
||||
, DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') as current_month1
|
||||
, DATE_PART('month', CURRENT_DATE - INTERVAL '15 days') as prev_month
|
||||
, TO_CHAR(CURRENT_DATE, 'YYYYMM') as current_month
|
||||
from daily_day_group
|
||||
where DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') = DATE_PART('month', CURRENT_DATE - INTERVAL '15 days')
|
||||
and (
|
||||
(
|
||||
start_day >= DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') and end_day <= DATE_PART('day', CURRENT_DATE - INTERVAL '3 days'))
|
||||
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
|
||||
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
|
||||
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '15 days')
|
||||
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '15 days')
|
||||
)
|
||||
union all
|
||||
select group_no, start_day, end_day
|
||||
, DATE_PART('day', CURRENT_DATE - INTERVAL '3 days') as current_day
|
||||
, DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') as prev_day
|
||||
, DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days') as prev_last_day
|
||||
, DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') as current_month1
|
||||
, DATE_PART('month', CURRENT_DATE - INTERVAL '15 days') as prev_month
|
||||
, (case when start_day <= 16 then
|
||||
TO_CHAR(CURRENT_DATE, 'YYYYMM')
|
||||
else
|
||||
TO_CHAR(CURRENT_DATE - INTERVAL '15 days', 'YYYYMM')
|
||||
end
|
||||
) as current_month
|
||||
from daily_day_group
|
||||
where DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') != DATE_PART('month', CURRENT_DATE - INTERVAL '15 days')
|
||||
and (
|
||||
-- 현재월 DAY 조회
|
||||
start_day >= 1 and end_day <= DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
|
||||
or start_day >= DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') and end_day <= DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
|
||||
|
||||
-- 3일전 DAY 로 시작, 종료일이 같은지 여부
|
||||
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
|
||||
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
|
||||
|
||||
-- 이전월 마지막 DAY 로 시작, 종료일이 같은지 여부
|
||||
or start_day = DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
|
||||
or end_day = DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
|
||||
)
|
||||
with register_period as (
|
||||
select generate_series((CURRENT_DATE - INTERVAL '${limitDay} days')::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date
|
||||
)
|
||||
select case when count(tdg.group_no) = count(dr.id) then 0 else count(tdg.group_no) - count(dr.id) end
|
||||
from temp_day_group tdg
|
||||
select count(rp.record_date) filter (where dr.id is null or dr.all_status = 'WAITING')
|
||||
from register_period rp
|
||||
left join
|
||||
daily_record dr on dr.record_month = tdg.current_month and dr.day_group_no = tdg.group_no
|
||||
and dr.household_seq = #{householdSeq}
|
||||
daily_record dr on dr.household_seq = #{householdSeq} and dr.is_deleted = false
|
||||
and dr.start_date <= rp.record_date and dr.end_date >= rp.record_date
|
||||
]]>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
<?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.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence.UpdateMonthlyInputStatusMapper">
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence.UpdateMonthlyInputStatusMapper">
|
||||
|
||||
<update id="updateMonthlyInputStatus">
|
||||
/* updateMonthlyInputStatus 월별현황 수정 */
|
||||
UPDATE monthly_input_status
|
||||
SET
|
||||
household_seq = #{householdSeq},
|
||||
month = #{month},
|
||||
forest_product_status = #{forestProductStatus},
|
||||
bank_auto_transfer_input_status = #{bankAutoTransferInputStatus},
|
||||
bank_auto_transfer_output_status = #{bankAutoTransferOutputStatus},
|
||||
<include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateMonthlyInputStatus">
|
||||
/* updateNotice 게시글 수정 */
|
||||
UPDATE monthly_input_status
|
||||
SET
|
||||
household_seq = #{householdSeq},
|
||||
month = #{month},
|
||||
forest_product_status = #{forestProductStatus},
|
||||
bank_auto_transfer_input_status = #{bankAutoTransferInputStatus},
|
||||
bank_auto_transfer_output_status = #{bankAutoTransferOutputStatus},
|
||||
<include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,59 +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.front.usecase.info.notice.createNotice.adapters.persistence.CreateNoticeMapper">
|
||||
|
||||
<insert id="createNotice" keyProperty="id">
|
||||
<!-- createNotice 게시글 등록 -->
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="long">
|
||||
SELECT nextval('notice_seq')
|
||||
</selectKey>
|
||||
|
||||
INSERT INTO notice (
|
||||
id,
|
||||
content,
|
||||
end_date,
|
||||
start_date,
|
||||
title,
|
||||
visible,
|
||||
created_at,
|
||||
created_by,
|
||||
updated_at,
|
||||
updated_by,
|
||||
is_deleted
|
||||
) VALUES (
|
||||
#{id},
|
||||
#{content},
|
||||
#{endDate},
|
||||
#{startDate},
|
||||
#{title},
|
||||
#{visible},
|
||||
#{createdAt},
|
||||
#{createdBy},
|
||||
#{updatedAt},
|
||||
#{updatedBy},
|
||||
false
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="createNoticeHasUploadFile">
|
||||
<!-- createNoticeHasUploadFile 게시글 등록 시, 첨부파일 join 데이터 등록 -->
|
||||
INSERT INTO notice_has_upload_file
|
||||
(
|
||||
notice_id,
|
||||
upload_files_id,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="fileMappingId" item="fileId" separator=",">
|
||||
(
|
||||
#{id},
|
||||
#{fileId},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,26 +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.front.usecase.info.notice.removeNotices.adapters.persistence.RemoveNoticesMapper">
|
||||
<update id="deleteNotices">
|
||||
/* deleteNotices : 게시물 삭제 */
|
||||
UPDATE notice
|
||||
SET <include refid="common.fields.DeleteBaseSet" />
|
||||
WHERE id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteNoticeHasFiles">
|
||||
/* deleteNoticeHasFiles : 게시물-파일 매핑 논리 삭제 */
|
||||
UPDATE notice_has_upload_file
|
||||
SET <include refid="common.fields.DeleteBaseSet" />
|
||||
WHERE notice_id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,44 +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.front.usecase.info.notice.updateNotice.adapters.persistence.UpdateNoticeMapper">
|
||||
|
||||
<update id="deleteFileUploads">
|
||||
/* deleteFileUploads 게시글 수정 시, 첨부파일 join 데이터 삭제 */
|
||||
UPDATE notice_has_upload_file
|
||||
SET <include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<insert id="createFileUploads">
|
||||
/* createFileUploads 게시글 수정 시, 첨부파일 join 데이터 등록 */
|
||||
INSERT INTO notice_has_upload_file
|
||||
(
|
||||
notice_id,
|
||||
upload_files_id,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="fileMappingId" item="fileId" separator=",">
|
||||
(
|
||||
#{id},
|
||||
#{fileId},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice">
|
||||
/* updateNotice 게시글 수정 */
|
||||
UPDATE notice
|
||||
SET
|
||||
content = #{content},
|
||||
end_date = #{endDate},
|
||||
start_date = #{startDate},
|
||||
title = #{title},
|
||||
visible = #{visible},
|
||||
<include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -5,10 +5,11 @@ uri.front.login=\uB85C\uADF8\uC778
|
||||
|
||||
# \uC785\uB825\uD604\uD669
|
||||
uri.front.status=\uC785\uB825\uD604\uD669
|
||||
uri.front.status.path=/status/daily
|
||||
|
||||
# \uD1B5\uACC4
|
||||
uri.front.statistics=\uD1B5\uACC4
|
||||
|
||||
# \uC774\uC6A9\uC548\uB0B4
|
||||
uri.front.guide=\uC774\uC6A9\uC548\uB0B4
|
||||
uri.front.guide.path=/guide
|
||||
|
||||
# \uB0B4\uC815\uBCF4
|
||||
uri.front.info=\uB0B4 \uC815\uBCF4
|
||||
|
||||
@@ -36,24 +36,34 @@ etUI.utils.ready(function () {
|
||||
};
|
||||
|
||||
// [공통] container 클래스 업데이트
|
||||
etUI.pages.updateContainerClassByLayout = function () {
|
||||
const container = document.getElementById('container');
|
||||
if (!container) return;
|
||||
etUI.pages.updateContainerClassByLayout = function () {
|
||||
const container = document.getElementById('container');
|
||||
const modalcontainer = document.querySelector('.modal-container');
|
||||
if (!container) return;
|
||||
|
||||
const hasFixedBtns = document.querySelector('.component-btns.fixed');
|
||||
const hasFooter = document.querySelector('footer');
|
||||
const hasFixedBtns = document.querySelector('.component-btns.fixed');
|
||||
const hasFooter = document.querySelector('footer');
|
||||
|
||||
// 조건에 맞게 클래스 추가/제거
|
||||
if (hasFixedBtns) {
|
||||
container.classList.add('btm-fixbtn');
|
||||
} else {
|
||||
container.classList.remove('btm-fixbtn');
|
||||
// container 클래스 처리
|
||||
if (hasFixedBtns) {
|
||||
container.classList.add('btm-fixbtn');
|
||||
} else {
|
||||
container.classList.remove('btm-fixbtn');
|
||||
}
|
||||
|
||||
if (hasFooter) {
|
||||
container.classList.add('btm-footer');
|
||||
} else {
|
||||
container.classList.remove('btm-footer');
|
||||
}
|
||||
|
||||
if (hasFooter) {
|
||||
container.classList.add('btm-footer');
|
||||
} else {
|
||||
container.classList.remove('btm-footer');
|
||||
// modalcontainer 클래스 처리 (fixed 버튼만 체크)
|
||||
if (modalcontainer) {
|
||||
if (hasFixedBtns) {
|
||||
modalcontainer.classList.add('btm-fixbtn');
|
||||
} else {
|
||||
modalcontainer.classList.remove('btm-fixbtn');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -323,10 +323,12 @@ var ajaxUtil = {
|
||||
if (ajaxUtil.loadingStatus) {
|
||||
ajaxUtil.loadingStatus = false;
|
||||
// TODO : 로딩바 숨김
|
||||
document.querySelector('#loadingBar').style.display = 'none';
|
||||
}
|
||||
},
|
||||
_showWaiting:function(){
|
||||
ajaxUtil.loadingStatus = true;
|
||||
// TODO : 로딩바 활성화
|
||||
document.querySelector('#loadingBar').style.display = 'block';
|
||||
},
|
||||
};
|
||||
@@ -1,266 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
|
||||
<style type="text/css">
|
||||
table, td {
|
||||
border: 1px solid
|
||||
}
|
||||
|
||||
table {
|
||||
width: 60%;
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<form autocomplete="off" method="get" name="reqForm" th:action="@{/board/articles}"
|
||||
th:object="${reqVO}">
|
||||
|
||||
<!-- hidden parameters -->
|
||||
<input name="sort" th:field="*{sort}" type="hidden"/>
|
||||
<input name="page" th:field="*{page}" type="hidden"/>
|
||||
|
||||
<div class="row p-2 mb-2 border-secondary border-top border-bottom border-1">
|
||||
<div class="col-5">
|
||||
<label class="col-sm-2 col-form-label" for="searchField">검색필드</label>
|
||||
<select class="form-select d-inline w-25" id="searchField"
|
||||
th:field="*{searchField}">
|
||||
<option selected value="">선택</option>
|
||||
<option value="title">제목</option>
|
||||
<option value="updatedBy">작성자</option>
|
||||
</select> <label>
|
||||
<input class="form-control d-inline" placeholder="검색어를 입력하세요."
|
||||
style="width: 250px;" th:field="*{searchValue}"
|
||||
type="text">
|
||||
</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label class="col-sm-3 col-form-label" for="searchOpen">공개여부</label>
|
||||
<select class="form-select d-inline w-25" id="searchOpen"
|
||||
th:field="*{searchOpen}">
|
||||
<option selected value="">전체</option>
|
||||
<option value="true">Y</option>
|
||||
<option value="false">N</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-outline-secondary" onclick="goSearch();"
|
||||
type="button">
|
||||
<!--<i class="bi bi-search"></i>-->
|
||||
검색
|
||||
</button>
|
||||
<button class="btn btn-outline-secondary" onclick="goInit();" type="button">
|
||||
초기화
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-start">
|
||||
<div class="fw-bolder text-muted">
|
||||
TOTAL. <span id="totalElements"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<i class="bi bi-list-ol"></i> <label>
|
||||
<select
|
||||
class="form-select form-select-sm" id="pageSize" name="size"
|
||||
onchange="goSearch()"
|
||||
th:field="*{size}">
|
||||
<option
|
||||
th:each="item : ${pageRows}"
|
||||
th:text="${item.codeText}" th:value="${item.codeValue}"></option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" style="width:40px;"><label>
|
||||
<input class="form-check-input"
|
||||
onchange="toggleCheckbox(this);" type="checkbox"/></label>
|
||||
</th>
|
||||
<th scope="col" style="width:60px;"></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="title"
|
||||
href="#">제목</a>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<a class="order-able text-center d-inline-block w-100" data-sort-field="visible"
|
||||
href="#">공개여부</a></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="startDate"
|
||||
href="#">게시일</a></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="endDate"
|
||||
href="#">종료일</a></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="updatedBy"
|
||||
href="#">최근 수정자</a></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="updatedAt"
|
||||
href="#">최근 수정일</a></th>
|
||||
<th scope="col">
|
||||
<a class="order-able" data-sort-field="orderNo"
|
||||
href="#">정렬번호</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sortable" id="listTBody">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="row paging"></div>
|
||||
<!--
|
||||
<div class="row">
|
||||
<div class="col text-start">
|
||||
<button type="button" class="btn btn-outline-secondary" onclick="goExcel();">
|
||||
<i class="bi bi-file-earmark-spreadsheet"></i> 엑셀 다운로드
|
||||
</button>
|
||||
</div>-->
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-outline-secondary" onclick="goSave();"
|
||||
type="button">
|
||||
<i class="bi bi-save2"></i> 등록
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const INIT_SORT = 'orderNo,DESC';
|
||||
|
||||
const getArticles = (pageNo) => {
|
||||
const f = document.reqForm;
|
||||
f.page.value = pageNo;
|
||||
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/board/articles',
|
||||
data: dataOj,
|
||||
success(response) {
|
||||
console.log(response);
|
||||
|
||||
$('#totalElements').text(response.totalElements);
|
||||
|
||||
// List 구성하기
|
||||
const tbody = $('#listTBody');
|
||||
tbody.empty();
|
||||
|
||||
$(response.content).each((idx, ct) => {
|
||||
tbody.append(
|
||||
`
|
||||
<tr data-order-no="${ct.orderNo}"
|
||||
data-id="${ct.id}">
|
||||
<th
|
||||
scope="row">${idx + (pageNo * f.size.value) + 1}</th>
|
||||
|
||||
<td><label>
|
||||
<input class="form-check-input"
|
||||
name="selectIds" type="checkbox" value="${ct.id}"/></label></td>
|
||||
<td><img
|
||||
src="${ct.uploadFile ? ct.uploadFile.referURL
|
||||
: '/static/ui/img/default-img.jpg'}"
|
||||
style="width: 25px;"
|
||||
class="img-thumbnail"/></td>
|
||||
<td><a href="javascript:goUpdate(${ct.id})">${ct.title}</a></td>
|
||||
<td class="text-secondary text-center">${ct.visible ? 'Y' : 'N'}</td>
|
||||
<td>${uiUtil.isoStrToReadable(ct.startDate)}</td>
|
||||
<td>${uiUtil.isoStrToReadable(ct.endDate)}</td>
|
||||
<td>${ct.updatedBy}</td>
|
||||
<td>${uiUtil.isoStrToReadable(ct.updatedAt)}</td>
|
||||
<td class="text-center">${ct.orderNo} <i
|
||||
class="bi bi-distribute-vertical handle float-end fw-bold"
|
||||
style="cursor: move"></i></td>
|
||||
</tr>
|
||||
`
|
||||
);
|
||||
});
|
||||
|
||||
if (!$(response.content).length) {
|
||||
tbody.append(`
|
||||
<tr>
|
||||
<td colspan="10" class="text-center text-muted">게시물이 존재하지 않습니다.</td>
|
||||
</tr>
|
||||
`);
|
||||
}
|
||||
|
||||
// Pagination 구성하기
|
||||
const paging = $('.paging');
|
||||
paging.empty();
|
||||
paging.append(
|
||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
||||
(movePageNo) => {
|
||||
f.page.value = movePageNo;
|
||||
goSearch();
|
||||
}));
|
||||
|
||||
// 리스트 상단 정렬 notation 및 갱신 기능 적용
|
||||
uiUtil.addSortNotation(f.sort.value, (targetPage, targetSort) => {
|
||||
f.page.value = targetPage;
|
||||
f.sort.value = targetSort;
|
||||
goSearch();
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 최초 리스트 로드
|
||||
getArticles(document.reqForm.page.value);
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const goSearch = () => {
|
||||
const f = document.reqForm;
|
||||
f.method = 'GET';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// 초기화
|
||||
function goInit() {
|
||||
const f = document.reqForm;
|
||||
f.searchField.value = '';
|
||||
f.searchValue.value = '';
|
||||
f.searchOpen.value = '';
|
||||
}
|
||||
|
||||
// 저장페이지 이동
|
||||
function goSave() {
|
||||
location.href = '/board/articles/create';
|
||||
}
|
||||
|
||||
// 수정페이지 이동
|
||||
function goUpdate(itemId) {
|
||||
location.href = '/board/articles/' + itemId;
|
||||
}
|
||||
|
||||
function goExcel() {
|
||||
const f = document.reqForm;
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
// size 를 제거하면 전체 목록을 가져온다.
|
||||
delete data.size;
|
||||
|
||||
location.href = '/api/board/articles/excel?' + new URLSearchParams(data).toString();
|
||||
}
|
||||
|
||||
// 체크박스 선택/해제
|
||||
function toggleCheckbox(oj) {
|
||||
$('input[name=selectIds]').prop("checked", oj.checked);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -1,202 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<style>
|
||||
.content {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.content label {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.content div {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.tox-tinymce {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
textarea.is-invalid ~ .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<form
|
||||
class="fw-bold"
|
||||
method="post" name="reqForm" th:action="@{/board/articles/create}">
|
||||
|
||||
<div class="content">
|
||||
<label>제목 *</label>
|
||||
<div>
|
||||
<input class="form-control unescapeText" id="title" name="title"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label class="form-label" for="boardStartDate">게시일 *</label>
|
||||
<div class="input-row">
|
||||
<div class="input-group">
|
||||
<input class="form-control flatpickr" id="boardStartDate" name="startDate"
|
||||
placeholder="게시일을 선택하세요" type="text"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input class="form-control flatpickr" id="boardEndDate" name="endDate"
|
||||
placeholder="종료일을 선택하세요" type="text"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label>공개여부</label>
|
||||
<div>
|
||||
<select class="form-select" id="open" name="visible">
|
||||
<option value="true">Y</option>
|
||||
<option value="false">N</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" style="max-width: 60rem;">
|
||||
<label for="content">내용 *</label>
|
||||
<div>
|
||||
<textarea class="form-control" id="content" name="content" rows="10"></textarea>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label for="representImgFile">대표 이미지</label>
|
||||
<div class="input-group">
|
||||
<input accept="image/*" class="form-control"
|
||||
id="representImgFile"
|
||||
name="representImgFile"
|
||||
onchange="uiUtil.uploadFile('EXAMPLE_REP', this);"
|
||||
type="file">
|
||||
<div class="invalid-feedback fw-bold">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content publicFileInputs">
|
||||
<label class="form-label d-block" for="formFile1">다건 파일 첨부</label>
|
||||
<button class="btn btn-outline-secondary d-inline-block align-top mb-2" onclick="addFileInput();"
|
||||
type="button"><i class="bi bi-plus-circle"></i> 파일 추가
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<button onclick="gotoList();">목록</button>
|
||||
<button onclick="goSave();">저장</button>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<!-- web editor - tinymce -->
|
||||
<script referrerpolicy="origin" src="/static/library/tinymce/6.0.3/tinymce.min.js"></script>
|
||||
<script src="/static/ui/editorImageUpload.js"></script>
|
||||
|
||||
<script>
|
||||
const goSave = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
// tinymce 는 사용자 입력을 받는 순간 몇몇 문자(&)를 escaping 한다.
|
||||
// xss 방지를 위한 html escape 는 필터를 통해 자동처리되니 전달시에는 원문 그대로를 던진다.
|
||||
f.content.value = uiUtil.unescapeHtml(tinymce.get('content').getContent());
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
traditional: true,
|
||||
method: 'POST',
|
||||
url: '/api/front/board/articles/create',
|
||||
data: obj,
|
||||
success: (res) => {
|
||||
alert(`'${f.title.value}' 게시물이 생성되었습니다.\n이전 화면으로 이동합니다.`);
|
||||
history.back();
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON;
|
||||
alert(resJson.message);
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
$(res.responseJSON).each((idx, oj) => {
|
||||
let target = $(f).find('[name=' + oj.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(oj.defaultMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function gotoList() {
|
||||
location.href = '/board/articles';
|
||||
}
|
||||
|
||||
function addFileInput() {
|
||||
const inputGroup = $(`
|
||||
<div class="input-group w-50">
|
||||
<input class="form-control mb-2" type="file" name="multipartAttachments"
|
||||
onchange="uiUtil.uploadFile('EXAMPLE_PUBLIC', this);">
|
||||
<div class="invalid-feedback fw-bold">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$('.publicFileInputs').append(inputGroup);
|
||||
|
||||
return inputGroup;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// date time picker
|
||||
$(".flatpickr").flatpickr({
|
||||
dateFormat: "Y-m-d\\TH:i",
|
||||
// altInput: true,
|
||||
// altFormat: "Y-m-d H:i",
|
||||
monthSelectorType: 'static',
|
||||
enableTime: true,
|
||||
time_24hr: true
|
||||
});
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
// init tinymce editor
|
||||
initEditor('#content');
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -1,251 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<style>
|
||||
.content {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.content label {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.content div {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.tox-tinymce {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
textarea.is-invalid ~ .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<form method="post" name="reqForm">
|
||||
<input name="id" th:value="${id}" type="hidden">
|
||||
<input name="orderNo" type="hidden">
|
||||
|
||||
<div class="content">
|
||||
<label>제목 *</label>
|
||||
<div>
|
||||
<input class="form-control unescapeText" id="title" name="title"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label class="form-label" for="boardStartDate">게시일 *</label>
|
||||
<div class="input-row">
|
||||
<div class="input-group">
|
||||
<input class="form-control flatpickr" id="boardStartDate" name="startDate"
|
||||
placeholder="게시일을 선택하세요" type="text"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input class="form-control flatpickr" id="boardEndDate" name="endDate"
|
||||
placeholder="종료일을 선택하세요" type="text"/>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label>공개여부</label>
|
||||
<div>
|
||||
<select class="form-select" id="open" name="visible">
|
||||
<option value="true">Y</option>
|
||||
<option value="false">N</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" style="max-width: 60rem;">
|
||||
<label for="content">내용 *</label>
|
||||
<div>
|
||||
<textarea class="form-control" id="content" name="content" rows="10"></textarea>
|
||||
<div class="invalid-feedback">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label for="representImgFile">대표 이미지</label>
|
||||
<div class="input-group">
|
||||
<input accept="image/*" class="form-control"
|
||||
id="representImgFile"
|
||||
name="representImgFile"
|
||||
onchange="uiUtil.uploadFile('EXAMPLE_REP', this);"
|
||||
type="file">
|
||||
<div class="invalid-feedback fw-bold">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content publicFileInputs">
|
||||
<label class="form-label d-block" for="formFile1">다건 파일 첨부</label>
|
||||
<button class="btn btn-outline-secondary d-inline-block align-top mb-2" onclick="addFileInput();"
|
||||
type="button"><i class="bi bi-plus-circle"></i> 파일 추가
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<button onclick="gotoList();">목록</button>
|
||||
<button onclick="goSave();">저장</button>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<!-- web editor - tinymce -->
|
||||
<script referrerpolicy="origin" src="/static/library/tinymce/6.0.3/tinymce.min.js"></script>
|
||||
<script src="/static/ui/editorImageUpload.js"></script>
|
||||
|
||||
<script>
|
||||
function gotoList() {
|
||||
location.href = '/board/articles';
|
||||
}
|
||||
|
||||
function addFileInput() {
|
||||
const inputGroup = $(`
|
||||
<div class="input-group w-50">
|
||||
<input class="form-control mb-2" type="file" name="multipartAttachments"
|
||||
onchange="uiUtil.uploadFile('EXAMPLE_PUBLIC', this);">
|
||||
<div class="invalid-feedback fw-bold">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$('.publicFileInputs').append(inputGroup);
|
||||
|
||||
return inputGroup;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
// date time picker
|
||||
$(".flatpickr").flatpickr({
|
||||
enableTime: true,
|
||||
dateFormat: "Y-m-d\\TH:i",
|
||||
monthSelectorType: 'static',
|
||||
time_24hr: true
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const getArticle = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/front/board/articles/' + f.id.value,
|
||||
success(res) {
|
||||
console.log(res);
|
||||
|
||||
initEditor('#content', (editor) => {
|
||||
editor.on('init', function () {
|
||||
setTimeout(() => {
|
||||
tinymce.get('content').setContent(uiUtil.unescapeHtml(res.content));
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
|
||||
f.title.value = uiUtil.unescapeHtml(res.title);
|
||||
f.startDate.value = res.startDate.substring(0, 16);
|
||||
f.endDate.value = res.endDate.substring(0, 16);
|
||||
f.visible.value = res.visible;
|
||||
f.orderNo.value = res.orderNo;
|
||||
|
||||
res.uploadFiles.forEach((uploadFile) => {
|
||||
switch (uploadFile.type.name) {
|
||||
// 대표 이미지
|
||||
case 'EXAMPLE_REP':
|
||||
const input = $(f.representImgFile);
|
||||
input.parent().append(
|
||||
`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFileInfo(input, uploadFile, true);
|
||||
break;
|
||||
// 다건 첨부 파일
|
||||
case 'EXAMPLE_PUBLIC':
|
||||
let inputGroup = addFileInput();
|
||||
inputGroup.append(
|
||||
`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFileInfo(inputGroup.find('input[type=file]'), uploadFile, false);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 상세정보 얻기
|
||||
getArticle();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const goSave = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
// tinymce 는 사용자 입력을 받는 순간 몇몇 문자(&)를 escaping 한다.
|
||||
// xss 방지를 위한 html escape 는 필터를 통해 자동처리되니 전달시에는 원문 그대로를 던진다.
|
||||
f.content.value = uiUtil.unescapeHtml(tinymce.get('content').getContent());
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
traditional: true,
|
||||
method: 'PUT',
|
||||
url: '/api/front/board/articles/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success: (res) => {
|
||||
if (confirm(`'${uiUtil.unescapeHtml(res.title)}' 게시물이 수정되었습니다.`)) {
|
||||
location.href = '/board/articles/' + res.id;
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON;
|
||||
alert(resJson.message);
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
$(res.responseJSON).each((idx, oj) => {
|
||||
let target = $(f).find('[name=' + oj.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(oj.defaultMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -1,427 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<style>
|
||||
.content {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.content label {
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.content div {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.comment-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.comment-actions {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<form class="fw-bold" name="reqForm">
|
||||
<input name="articleId" th:value="${id}" type="hidden">
|
||||
|
||||
<!-- pageable parameters -->
|
||||
<input name="page" type="hidden"/>
|
||||
|
||||
<div class="content">
|
||||
<label>제목</label>
|
||||
<div id="title" name="title"></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label>게시일</label>
|
||||
<div id="postDate" name="postDate"></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label>공개여부</label>
|
||||
<div id="visible" name="visible"></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<label>내용</label>
|
||||
<div id="content" name="content"></div>
|
||||
</div>
|
||||
<div class="content uploadFile representImgFile">
|
||||
<label for="representImgFile">대표 이미지</label>
|
||||
<div class="input-group">
|
||||
<div id="representImgFile" name="representImgFile"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content uploadFile publicFileInputs">
|
||||
<label>다건 파일</label>
|
||||
</div>
|
||||
|
||||
<div class="button-group" style="margin-bottom: 50px;">
|
||||
<button onclick="gotoList();" type="button">목록</button>
|
||||
<button onclick="goUpdate();" th:if="${isAuthor}" type="button">수정</button>
|
||||
<button onclick="goRemove();" th:if="${isAuthor}" type="button">삭제</button>
|
||||
</div>
|
||||
|
||||
<!-- 댓글 -->
|
||||
<div class="comment-section" style="margin-bottom: 50px;">
|
||||
<div class="comment-form">
|
||||
<label>댓글</label>
|
||||
<div class="input-group">
|
||||
<input id="newCommentInput" name="commentContent" placeholder="댓글을 입력하세요" type="text">
|
||||
<button onclick="saveComment()" type="button">등록</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 댓글 리스트 -->
|
||||
<div id="commentList"></div>
|
||||
<button id="moreBtn" onclick="moreCommentBtn();" style="display: none;" type="button">
|
||||
더보기
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
function gotoList() {
|
||||
location.href = '/board/articles';
|
||||
}
|
||||
|
||||
function goUpdate() {
|
||||
const f = document.reqForm;
|
||||
location.href = '/board/articles/update/' + f.articleId.value;
|
||||
}
|
||||
|
||||
function addFileInput() {
|
||||
const inputGroup = $(`
|
||||
<div class="input-group">
|
||||
<div class="multiFile"></div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$('.publicFileInputs').append(inputGroup);
|
||||
|
||||
return inputGroup;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 게시물 데이터 조회
|
||||
const getArticle = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/front/board/articles/' + f.articleId.value,
|
||||
success(res) {
|
||||
console.log("data : ", res);
|
||||
|
||||
$('#title').text(uiUtil.unescapeHtml(res.title));
|
||||
$('#postDate').text(
|
||||
res.startDate.substring(0, 10) + ' - ' + res.endDate.substring(0, 10));
|
||||
$('#visible').text(res.visible ? 'Y' : 'N');
|
||||
$('#content').html(uiUtil.unescapeHtml(res.content));
|
||||
$('#orderNo').val(res.orderNo);
|
||||
|
||||
$('.uploadFile').hide();
|
||||
|
||||
res.uploadFiles.forEach((uploadFile) => {
|
||||
switch (uploadFile.type.name) {
|
||||
// 대표 이미지
|
||||
case 'EXAMPLE_REP':
|
||||
const input = $("#representImgFile");
|
||||
input.parent().append(
|
||||
`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFrontFileInfo(input, uploadFile, true);
|
||||
$('.representImgFile').show();
|
||||
break;
|
||||
// 다건 첨부 파일
|
||||
case 'EXAMPLE_PUBLIC':
|
||||
let inputGroup = addFileInput();
|
||||
inputGroup.append(
|
||||
`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFrontFileInfo(inputGroup.find('.multiFile'), uploadFile, false);
|
||||
$('.publicFileInputs').show();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getArticle();
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const goRemove = () => {
|
||||
if (confirm(/*[[#{operation.board.article.remove.ask}]]*/)) {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
$.ajax({
|
||||
'method': 'DELETE',
|
||||
'url': '/api/front/board/articles/remove',
|
||||
'data': {
|
||||
'selectIds': obj.articleId
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
alert('게시물이 삭제되었습니다.');
|
||||
gotoList();
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (response) {
|
||||
const resJson = response.responseJSON;
|
||||
alert(resJson.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 댓글 데이터 조회
|
||||
const getArticleComments = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/front/board/articles/comments',
|
||||
data: obj,
|
||||
success(res) {
|
||||
// 댓글 렌더링
|
||||
res.content.forEach((comment) => {
|
||||
const commentElement = createCommentElement(comment);
|
||||
$('#commentList').append(commentElement);
|
||||
});
|
||||
|
||||
// 더보기 버튼 표시/숨김 처리
|
||||
f.page.value = res.number;
|
||||
const currentPage = parseInt(f.page.value);
|
||||
const pageSize = parseInt(res.size);
|
||||
const totalPages = Math.ceil(res.totalElements / pageSize);
|
||||
if (currentPage >= totalPages - 1) {
|
||||
$('#moreBtn').hide();
|
||||
} else {
|
||||
$('#moreBtn').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 초기 로드 호출
|
||||
getArticleComments();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 댓글 더보기 버튼
|
||||
function moreCommentBtn() {
|
||||
const f = document.reqForm;
|
||||
const pageInput = $(f).find('input[name="page"]');
|
||||
|
||||
// 현재 페이지 증가
|
||||
pageInput.val(parseInt(pageInput.val()) + 1);
|
||||
|
||||
getArticleComments();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
// 댓글 추가 html
|
||||
function createCommentElement(data) {
|
||||
return $(`
|
||||
<div class="comment" data-comment-id="${data.id}">
|
||||
<div class="comment-header">
|
||||
<div class="comment-info">
|
||||
<label class="author">${data.createdBy}</label>
|
||||
<span class="date">${formatDate(data.updatedAt)}</span>
|
||||
<div class="comment-actions">
|
||||
${data.isAuthor == null || data.isAuthor ? `
|
||||
<button type="button" onclick="editComment(this)">수정</button>
|
||||
<button type="button" onclick="removeComment(this)">삭제</button>
|
||||
` : ''}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="comment-body">
|
||||
<div class="content">${data.content}</div>
|
||||
<div class="edit-form" style="display: none;">
|
||||
<input type="text" class="edit-input" value="${data.content}">
|
||||
<button type="button" onclick="saveEdit(this)">저장</button>
|
||||
<button type="button" onclick="cancelEdit(this)">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
|
||||
// 댓글 저장
|
||||
function saveComment() {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/api/front/board/articles/comment/create',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success: (res) => {
|
||||
const commentElement = createCommentElement(res);
|
||||
$('#commentList').prepend(commentElement);
|
||||
$('#newCommentInput').val('');
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON;
|
||||
alert(resJson.message);
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
$(res.responseJSON).each((idx, oj) => {
|
||||
alert(oj.defaultMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 댓글 수정 모드로 전환
|
||||
function editComment(button) {
|
||||
const comment = $(button).closest('.comment');
|
||||
const content = comment.find('.content');
|
||||
const editForm = comment.find('.edit-form');
|
||||
const editInput = comment.find('.edit-input');
|
||||
const commentActions = comment.find('.comment-actions');
|
||||
|
||||
commentActions.hide();
|
||||
content.hide();
|
||||
editForm.show();
|
||||
editInput.val(content.text()).focus();
|
||||
}
|
||||
|
||||
// 댓글 수정 저장
|
||||
function saveEdit(button) {
|
||||
const f = document.reqForm;
|
||||
const comment = $(button).closest('.comment');
|
||||
const commentId = comment.data('comment-id');
|
||||
const editInput = comment.find('.edit-input');
|
||||
const commentContent = editInput.val();
|
||||
|
||||
$.ajax({
|
||||
method: 'PUT',
|
||||
url: '/api/front/board/articles/comment/update',
|
||||
data: {
|
||||
commentId: commentId,
|
||||
commentContent: commentContent,
|
||||
articleId: f.articleId.value
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success: (res) => {
|
||||
const content = comment.find('.content');
|
||||
const editForm = comment.find('.edit-form');
|
||||
const commentActions = comment.find('.comment-actions');
|
||||
|
||||
content.text(res.content).show();
|
||||
editForm.hide();
|
||||
commentActions.show();
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON;
|
||||
alert(resJson.message);
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
$(res.responseJSON).each((idx, oj) => {
|
||||
alert(oj.defaultMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 댓글 수정 취소
|
||||
function cancelEdit(button) {
|
||||
const comment = $(button).closest('.comment');
|
||||
const content = comment.find('.content');
|
||||
const editForm = comment.find('.edit-form');
|
||||
const commentActions = comment.find('.comment-actions');
|
||||
|
||||
content.show();
|
||||
editForm.hide();
|
||||
commentActions.show();
|
||||
}
|
||||
|
||||
// 댓글 삭제
|
||||
function removeComment(button) {
|
||||
const comment = $(button).closest('.comment');
|
||||
const commentId = comment.data('comment-id');
|
||||
|
||||
if (confirm(/*[[#{operation.board.article.comment.remove.ask}]]*/)) {
|
||||
$.ajax({
|
||||
'method': 'DELETE',
|
||||
'url': '/api/front/board/articles/comment/remove',
|
||||
'data': {
|
||||
'removeId': commentId
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
$(button).closest('.comment').remove();
|
||||
},
|
||||
statusCode: {
|
||||
// error
|
||||
400: function (response) {
|
||||
const resJson = response.responseJSON;
|
||||
alert(resJson.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function formatDate(isoString) {
|
||||
const date = new Date(isoString);
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -1,138 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<form enctype="multipart/form-data"
|
||||
method="post"
|
||||
name="updateForm" th:action="@{/board/exampleBoard/} + ${formDto.editMode ? 'update' : 'create'}"
|
||||
th:object="${formDto}">
|
||||
<input name="editMode" th:value="${formDto.editMode}" type="hidden"/>
|
||||
<input name="id" th:if="${formDto.editMode}" th:value="${formDto.id}" type="hidden"/>
|
||||
|
||||
<div>
|
||||
<h1 th:text="${formDto.title}">
|
||||
</h1>
|
||||
|
||||
<div>
|
||||
<label>게시일 *</label>
|
||||
<div>
|
||||
<span th:text="${formDto.boardStartDate}"></span> ~ <span
|
||||
th:text="${formDto.boardEndDate}"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>공개여부</label>
|
||||
<div th:text="${formDto.visible}">
|
||||
</div>
|
||||
|
||||
<div th:utext="${formDto.content}">
|
||||
|
||||
</div>
|
||||
|
||||
<div th:if="${formDto.editMode}">
|
||||
<label for="content" style="padding-top: 0;">public 파일</label>
|
||||
<div>
|
||||
<div th:each="item, status : ${formDto.uploadedFiles}">
|
||||
<a th:attr="data-file-seq=${item.seq}" th:href="${@commonUtil.getPublicIOPath(item)}"
|
||||
th:text="${item.originalFilename}"
|
||||
></a>
|
||||
<a href="javascript:void(0);" onclick="removeFile(this);"
|
||||
th:attr="data-del-file-seq=${item.seq}"><i
|
||||
></i></a>
|
||||
<a href="javascript:void(0);" onclick="cancelRemove(this);" style="display: none;"
|
||||
th:attr="data-cancel-file-seq=${item.seq}"
|
||||
> (취소)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:if="${formDto.editMode}">
|
||||
<label for="content" style="padding-top: 0;">private 파일</label>
|
||||
<div>
|
||||
<div th:each="item, status : ${formDto.uploadedPrivates}">
|
||||
<a th:attr="data-file-seq=${item.seq}" th:href="${@commonUtil.getPrivateIOPath(item)}"
|
||||
th:text="${item.originalFilename}"
|
||||
></a>
|
||||
<a href="javascript:void(0);" onclick="removeFile(this);"
|
||||
th:attr="data-del-file-seq=${item.seq}"><i
|
||||
></i></a>
|
||||
<a href="javascript:void(0);" onclick="cancelRemove(this);" style="display: none;"
|
||||
th:attr="data-cancel-file-seq=${item.seq}"
|
||||
> (취소)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button onclick="gotoList();return false;" type="button">목록으로 이동</button>
|
||||
</form>
|
||||
|
||||
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
|
||||
<form method="get" name="prevParamForm" th:action="@{/board/exampleBoard}"
|
||||
th:if="${formDto.editMode}"
|
||||
th:object="${paramDto}">
|
||||
<input th:field="*{searchField}" type="hidden">
|
||||
<input th:field="*{searchValue}" type="hidden">
|
||||
<input th:field="*{searchOpen}" type="hidden">
|
||||
<input th:field="*{page}" type="hidden">
|
||||
<input th:field="*{size}" type="hidden">
|
||||
<input th:field="*{sort}" type="hidden">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function gotoList() {
|
||||
document.prevParamForm ? document.prevParamForm.submit()
|
||||
: location.href = '/board/exampleBoard';
|
||||
}
|
||||
|
||||
function removeFile(oj) {
|
||||
const fileSeq = $(oj).data('del-file-seq');
|
||||
const el = $('a[data-file-seq=' + fileSeq + ']');
|
||||
el.addClass('text-decoration-line-through');
|
||||
$(oj).hide();
|
||||
|
||||
const cancelEl = $('a[data-cancel-file-seq=' + fileSeq + ']');
|
||||
cancelEl.show();
|
||||
|
||||
const f = document.updateForm;
|
||||
let input = $('<input type="hidden" name="delFileSeq">');
|
||||
input.val(fileSeq);
|
||||
input.attr('id', 'del_' + fileSeq);
|
||||
$(f).append(input);
|
||||
}
|
||||
|
||||
function cancelRemove(oj) {
|
||||
const fileSeq = $(oj).data('cancel-file-seq');
|
||||
const el = $('a[data-file-seq=' + fileSeq + ']');
|
||||
el.removeClass('text-decoration-line-through');
|
||||
|
||||
$('#del_' + fileSeq).remove();
|
||||
|
||||
$('a[data-del-file-seq=' + fileSeq + ']').show();
|
||||
|
||||
$(oj).hide();
|
||||
}
|
||||
|
||||
function addFileInput(type) {
|
||||
let tmpl = $.templates('#fileInputTmpl');
|
||||
switch (type) {
|
||||
case 'public':
|
||||
$('.publicFileInputs').append(tmpl.render({'name': 'multipartFiles'}));
|
||||
break;
|
||||
case 'private':
|
||||
$('.privateFileInputs').append(tmpl.render({'name': 'privateFiles'}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script id="fileInputTmpl" type="text/x-jsrender">
|
||||
<input type="file" name="{{:name}}"/>
|
||||
|
||||
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -1,174 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
|
||||
<form method="post" name="paramForm" onsubmit="goSearch();"
|
||||
th:action="@{/board/exampleBoard}" th:object="${paramDto}">
|
||||
|
||||
<!-- hidden parameters -->
|
||||
<input name="page" th:value="${listOutput.pageable.pageNumber}" type="hidden"/>
|
||||
<input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/>
|
||||
|
||||
<div style="--bs-bg-opacity: .2;">
|
||||
<div>
|
||||
<label for="searchField">검색필드</label>
|
||||
<select id="searchField"
|
||||
th:field="*{searchField}">
|
||||
<option selected value="">선택</option>
|
||||
<option value="title">제목</option>
|
||||
<option value="createdBy">작성자</option>
|
||||
</select> <label>
|
||||
<input placeholder="검색어를 입력하세요."
|
||||
style="width: 250px;" th:field="*{searchValue}"
|
||||
type="text">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="searchOpen">공개여부</label>
|
||||
<select id="searchOpen"
|
||||
th:field="*{searchOpen}">
|
||||
<option selected value="">전체</option>
|
||||
<option value="true">Y</option>
|
||||
<option value="false">N</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="goSearch();"
|
||||
type="button">검색
|
||||
</button>
|
||||
<button onclick="goInit();" type="button">초기화
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
Total: <span th:text="${listOutput.totalElements}"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<i></i> <label> <select
|
||||
onchange="goSearch()"
|
||||
th:field="*{size}">
|
||||
<option
|
||||
th:each="item : ${pageRows}"
|
||||
th:selected="${#strings.toString(listOutput.pageable.pageSize) eq item.codeValue}" th:text="${item.codeText}"
|
||||
th:value="${item.codeValue}"></option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><label>
|
||||
<input
|
||||
onchange="toggleCheckbox(this);" type="checkbox"/></label>
|
||||
</th>
|
||||
<th scope="col"><a data-sort-field="title"
|
||||
href="#">제목</a></th>
|
||||
<th scope="col"><a data-sort-field="open"
|
||||
href="#">공개여부</a></th>
|
||||
<th scope="col"><a data-sort-field="boardStartDate"
|
||||
href="#">게시일</a></th>
|
||||
<th scope="col"><a data-sort-field="boardEndDate"
|
||||
href="#">종료일</a></th>
|
||||
<th scope="col"><a data-sort-field="updatedBy"
|
||||
href="#">수정자</a></th>
|
||||
<th scope="col"><a data-sort-field="updatedAt"
|
||||
href="#">최근 수정일</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="item, status : ${listOutput.content}">
|
||||
<th
|
||||
scope="row"
|
||||
th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">게시물번호
|
||||
</th>
|
||||
<td><label>
|
||||
<input
|
||||
name="checkedIds" th:value="${item.id}" type="checkbox"/></label>
|
||||
<td><a th:href="|javascript:goSave('${item.id}')|"
|
||||
th:text="${item.title}">Title</a></td>
|
||||
<td><i th:if="${item.visible}"></i> <i
|
||||
th:if="${!item.visible}"></i></td>
|
||||
<td
|
||||
th:text="${#temporals.format(item.boardStartDate, 'yyyy-MM-dd hh:mm')}">게시일
|
||||
</td>
|
||||
<td
|
||||
th:text="${#temporals.format(item.boardEndDate, 'yyyy-MM-dd hh:mm')}">종료일
|
||||
</td>
|
||||
<td th:text="${item.updatedBy}">작성자</td>
|
||||
<td
|
||||
th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<div th:replace="common/list-components :: pagination(${listOutput})"></div>
|
||||
|
||||
<script th:inline="javascript">
|
||||
// 검색
|
||||
function goSearch() {
|
||||
const f = document.paramForm;
|
||||
f.action = '/board/exampleBoard';
|
||||
f.page.value = 0;
|
||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
f.method = 'get';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// 초기화
|
||||
function goInit() {
|
||||
const f = document.paramForm;
|
||||
f.searchField.value = '';
|
||||
f.searchValue.value = '';
|
||||
f.searchOpen.value = '';
|
||||
}
|
||||
|
||||
// 수정페이지 이동
|
||||
function goSave(itemId) {
|
||||
const f = document.paramForm;
|
||||
f.action = '/board/exampleBoard/update/' + itemId;
|
||||
f.method = 'get';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function goExcel() {
|
||||
const f = document.paramForm;
|
||||
f.action = '/board/exampleBoard/excel';
|
||||
f.method = 'get';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// 체크박스 선택/해제
|
||||
function toggleCheckbox(oj) {
|
||||
$('input[name=checkedIds]').prop("checked", oj.checked);
|
||||
}
|
||||
|
||||
function goRemove() {
|
||||
if (!$('input[name=checkedIds]').is(':checked')) {
|
||||
alert(/*[[#{operation.common.remove.choose}]]*/);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirm(/*[[#{operation.common.remove.ask}]]*/)) {
|
||||
const f = document.paramForm;
|
||||
f.action = '/board/exampleBoard/delete';
|
||||
f.method = 'post';
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -171,10 +171,14 @@
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/record/')} ? 'active'">
|
||||
<a th:href="#{uri.front.record.calendar.path}">일계부</a>
|
||||
</li>
|
||||
<!--/* TODO : 2차 오픈 s */-->
|
||||
<li class="menu-regi disabled"><a href="javascript:void(0)">입력현황</a></li>
|
||||
<li class="menu-use disabled"><a href="javascript:void(0)">이용안내</a></li>
|
||||
<!--/* TODO : 2차 오픈 e */-->
|
||||
<li class="menu-regi"
|
||||
th:classappend="${#strings.containsIgnoreCase(currentURI?.uri, '/status/')} ? 'active'">
|
||||
<a th:href="#{uri.front.status.path}">입력현황</a>
|
||||
</li>
|
||||
<li class="menu-use"
|
||||
th:classappend="${#strings.containsIgnoreCase(currentURI?.uri, '/guide')} ? 'active'">
|
||||
<a th:href="#{uri.front.guide.path}">이용안내</a>
|
||||
</li>
|
||||
<li class="menu-info"
|
||||
th:classappend="${#strings.equals(currentURI?.uri, '/info')
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/info/')} ? 'active'">
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
<ul class="allmenu-list" th:if="${topNode != null}">
|
||||
<li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}"
|
||||
th:with="accoClass=${#strings.containsIgnoreCase(menu.uri, '/record') ? 'acco': ''}
|
||||
, infoClass=${#strings.containsIgnoreCase(menu.uri, '/info') ? 'info': ''}"
|
||||
th:class="|${accoClass}${infoClass}|"
|
||||
, infoClass=${#strings.containsIgnoreCase(menu.uri, '/info') ? 'info': ''}
|
||||
, statusClass=${#strings.containsIgnoreCase(menu.uri, '/status') ? 'regi': ''}
|
||||
, guideClass=${#strings.containsIgnoreCase(menu.uri, '/guide') ? 'use': ''}"
|
||||
th:class="|${accoClass}${infoClass}${statusClass}${guideClass}|"
|
||||
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'">
|
||||
<!--/* 자식 nodes 가 없는 경우 */-->
|
||||
<a th:classappend="${currentURI.id == menu.id}? 'active'"
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
</main>
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<div class="info-msg">
|
||||
<span>Error</span> <span class="text-muted" th:text="${error}"></span>
|
||||
<br/>
|
||||
<span>Message</span> <span class="text-muted" th:text="${message}"></span>
|
||||
<span class="text-muted" th:text="${error}"></span>
|
||||
<span class="text-muted" th:text="${message}"></span>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
</main>
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<div class="info-msg">
|
||||
<span>Error</span> <span class="text-muted" th:text="${error}"></span>
|
||||
<br/>
|
||||
<span>Message</span> <span class="text-muted" th:text="${message}"></span>
|
||||
<span class="text-muted" th:text="${error}"></span>
|
||||
<span class="text-muted" th:text="${message}"></span>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
11
front/src/main/resources/templates/guide/index.html
Normal file
11
front/src/main/resources/templates/guide/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<main id="content" role="main">
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${currentMonthlyInfo.koreanMonth}]]의 <br>
|
||||
<strong>은행 자동이체(수입) 내역 <span id="totalItems">[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
<p>수입 내역을 등록해 주세요.</p>
|
||||
@@ -105,6 +106,7 @@
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.bank.path}]]*/ 'rootUrl',
|
||||
preMonth: /*[[|/info/bank/create/input|]]*/ 'preMonthUrl',
|
||||
save: /*[[|/api/front#{uri.front.info.bank.path}/create|]]*/ 'saveUrl'
|
||||
},
|
||||
module: {
|
||||
@@ -117,9 +119,12 @@
|
||||
bankList : /*[[${bankList.content}]]*/ [],
|
||||
pastBankList : /*[[${pastBankList.content}]]*/ [],
|
||||
id: /*[[${currentMonthlyInfo.id}]]*/'',
|
||||
currentMonth: /*[[${currentMonthlyInfo.month}]]*/'',
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferInputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferInputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
@@ -198,11 +203,42 @@
|
||||
|
||||
const clearAllItems = document.getElementById('clearAllItems');
|
||||
|
||||
if (ENV.data.pastBankList.length == 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
}
|
||||
|
||||
if (ENV.data.editable) {
|
||||
if(ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508"){
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
const handlePageShow = function(event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastInputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({ persisted: false, performance: window.performance });
|
||||
|
||||
}
|
||||
if (ENV.data.currentStatus == "NONE") {
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${currentMonthlyInfo.koreanMonth}]]의 <br>
|
||||
<strong>은행 자동이체(지출) 내역 <span id="totalItems">[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
<p>지출 내역을 등록해 주세요.</p>
|
||||
@@ -105,6 +106,7 @@
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.bank.path}]]*/ 'rootUrl',
|
||||
preMonth: /*[[|/info/bank/create/output|]]*/ 'preMonthUrl',
|
||||
save: /*[[|/api/front#{uri.front.info.bank.path}/create|]]*/ 'saveUrl'
|
||||
},
|
||||
module: {
|
||||
@@ -119,7 +121,9 @@
|
||||
id: /*[[${currentMonthlyInfo.id}]]*/'',
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
@@ -197,11 +201,44 @@
|
||||
|
||||
const clearAllItems = document.getElementById('clearAllItems');
|
||||
|
||||
if (ENV.data.pastBankList.length == 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
}
|
||||
|
||||
if (ENV.data.editable) {
|
||||
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
const handlePageShow = function(event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastOutputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastOutputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastOutputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({ persisted: false, performance: window.performance });
|
||||
}
|
||||
|
||||
if (ENV.data.currentStatus == "NONE") {
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
|
||||
@@ -12,12 +12,24 @@
|
||||
info : 인포(파랑)
|
||||
*/-->
|
||||
<article class="alert-box warning"
|
||||
th:if="${dailyDataNone}">
|
||||
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
th:classappend="${#strings.equals(dailyDataNone, 'DONE')} ? 'success' : 'warning'">
|
||||
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DATA_NONE')}">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'FOREST_NONE')}">
|
||||
이번 달 임산물 현황이 등록되지 않았습니다. <br>
|
||||
정확한 조사를 위해 매월 1회 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'BANK_NONE')}">
|
||||
이번 달 자동이체 내역이 등록되지 않았습니다. <br>
|
||||
정확한 조사를 위해 매월 1회 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DONE')}">
|
||||
일계부를 성실하게 등록하고 계십니다. <br>
|
||||
정확한 조사를 위해 지금처럼 계속 입력해 주세요.
|
||||
</span>
|
||||
</article>
|
||||
|
||||
<section class="info-top-area">
|
||||
@@ -48,8 +60,7 @@
|
||||
|
||||
<section class="info-bottom-area bg-white bg-lround">
|
||||
<ul class="btn-link-list">
|
||||
<!--TODO 개인 정보 동의시 오픈 예정 -->
|
||||
<!-- <li>
|
||||
<li>
|
||||
<a href="/info/user/password">
|
||||
<i class="ico-privacy ico-normal" aria-hidden="true"></i>
|
||||
<dl>
|
||||
@@ -57,7 +68,7 @@
|
||||
<dd>이름, 주소, 연락처를 수정할 수 있어요</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</li>-->
|
||||
</li>
|
||||
<li>
|
||||
<a href="/info/monthly">
|
||||
<i class="ico-chart ico-normal" aria-hidden="true"></i>
|
||||
|
||||
@@ -219,34 +219,70 @@
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal confirmPopup" data-props-dimm-click="true">
|
||||
<div class="component-modal term-wrap confirmPopup" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit">개인정보 수집 및 활용 동의</h3>
|
||||
<h3 class="modal-tit">개인정보 변경 약관</h3>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<div>
|
||||
이런 저런 내용<br><br><br><br><br><br><br><br><br>모달 스크롤 적용필요!!!
|
||||
<div class="terms-group">
|
||||
<h3 class="terms-heading-h2">제1조 목적</h3>
|
||||
<ul class="terms-list bullet-type">
|
||||
<li class="terms-list-item">
|
||||
본 약관은 ㈜코리아리서치인터내셔널(이하 “회사”)가 제공하는 임가경제조사 일계부 (이하 “서비스”)에서 임가경영주(이하 “이용자”) 계정의 이름 및 휴대폰번호 등 변경 절차와 책임 범위를 간소화하여 규정함으로써, 임업 발전과 임업인 지원을 위한 정책수립, 임업경영 개선을 위한 연구의 기초 자료 확보함을 목적으로 합니다.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="component-btns">
|
||||
<div class="btns-row two-col">
|
||||
<div class="btns-col-1">
|
||||
<button type="button" class="btn btn-full btn-l btn-secondary"
|
||||
onclick="ENV.module.confirmPopup.close();">
|
||||
<span class="btn-txt">동의 안함</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary"
|
||||
onclick="formControl.confirmPopupOk()">
|
||||
<span class="btn-txt">동의</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="terms-group">
|
||||
<h3 class="terms-heading-h2">제2조 변경 대상 정보</h3>
|
||||
<ul class="terms-list bullet-type">
|
||||
<li class="terms-list-item">
|
||||
이용자는 다음 각 호의 개인정보를 변경 요청할 수 있습니다. <br>
|
||||
1. 이름 <br>
|
||||
2. 연령 <br>
|
||||
3. 가구연락처 <br>
|
||||
4. 휴대폰번호 <br>
|
||||
5. 주소
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="terms-group">
|
||||
<h3 class="terms-heading-h2">제3조 이용자의 의무</h3>
|
||||
<ul class="terms-list bullet-type">
|
||||
<li class="terms-list-item">
|
||||
이용자는 변경 요청 시 허위·부정확한 정보를 입력해서는 안 되며, 이로 인한 손해를 배상할 책임이 있습니다.
|
||||
</li>
|
||||
<li class="terms-list-item">
|
||||
이용자는 계정 정보의 보안을 유지할 책임이 있으며, 제3자에게 계정 정보를 공유하거나 위·변조된 정보를 제공해서는 안 됩니다.
|
||||
</li>
|
||||
<li class="terms-list-item">
|
||||
이용자는 직계 가족(배우자, 자녀 등)으로서 대표자로 조사에 참여하거나 일계부 데이터를 등록하기 위하여 개인정보를 변경하는 경우를 제외하고, 어떠한 제3자도 본 서비스를 이용할 수 없습니다. 제3자가 본 서비스를 부당하게 이용하여 발생한 모든 손해에 대해 해당 이용자가 책임을 부담합니다.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="terms-group">
|
||||
<h3 class="terms-heading-h2">제4조 기타</h3>
|
||||
<ul class="terms-list bullet-type">
|
||||
<li class="terms-list-item">
|
||||
이 약관의 개정 절차에 관해서는 최초 동의한 개인정보처리방침·이용약관의 개정 절차를 따릅니다.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-btns fixed">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary"
|
||||
onclick="ENV.module.confirmPopup.close();">
|
||||
<span class="btn-txt">동의 안 함</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
onclick="formControl.confirmPopupOk()">
|
||||
<span class="btn-txt">동의</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="modal-close"></button>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<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,6 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<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,6 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<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">
|
||||
|
||||
@@ -10,13 +10,25 @@
|
||||
success : 성공(초록)
|
||||
info : 인포(파랑)
|
||||
*/-->
|
||||
<article class="alert-box warning"
|
||||
th:if="${dailyDataNone}">
|
||||
<article class="alert-box"
|
||||
th:classappend="${#strings.equals(dailyDataNone, 'DONE')} ? 'success' : 'warning'">
|
||||
<p class="tit"
|
||||
sec:authorize="isAuthenticated()"><strong th:text="${#authentication.principal.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DATA_NONE')}">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'FOREST_NONE')}">
|
||||
이번 달 임산물 현황이 등록되지 않았습니다. <br>
|
||||
정확한 조사를 위해 매월 1회 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'BANK_NONE')}">
|
||||
이번 달 자동이체 내역이 등록되지 않았습니다. <br>
|
||||
정확한 조사를 위해 매월 1회 입력해 주세요.
|
||||
</span>
|
||||
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DONE')}">
|
||||
일계부를 성실하게 등록하고 계십니다. <br>
|
||||
정확한 조사를 위해 지금처럼 계속 입력해 주세요.
|
||||
</span>
|
||||
</article>
|
||||
|
||||
@@ -662,8 +674,6 @@
|
||||
|
||||
async _getData(month) {
|
||||
await new Promise(resolve => setTimeout(resolve, DatepickerComponent.CONSTANTS.LOADING_DELAY))
|
||||
//const response = await fetch(`http://localhost:8888/assets/json/${month}.json`)
|
||||
//TODO
|
||||
const response = await fetch(`/api/record/calendar/${month}`)
|
||||
return await response.json()
|
||||
}
|
||||
@@ -730,7 +740,6 @@
|
||||
// viewDate: instanceof Date
|
||||
console.log('changeDateCallback', data, currentDate, viewDate);
|
||||
|
||||
// TODO
|
||||
formControl.setDetail(data, currentDate, viewDate);
|
||||
}, function(monthKey, currentDate) {
|
||||
console.log('changeMonthCallback', monthKey, currentDate);
|
||||
@@ -757,6 +766,7 @@
|
||||
root: '',
|
||||
list: '/record/calendar/{searchMonth}/{groupNo}',
|
||||
create: '/record/daily/{searchMonth}/{groupNo}',
|
||||
alert: '/api/record/daily/alert/{searchMonth}',
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
@@ -791,15 +801,89 @@
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
carryOver: rowdata.carryOver != null ? Number(rowdata.carryOver).toLocaleString() : null,
|
||||
});
|
||||
}
|
||||
|
||||
$('#selectedDay').html(html);
|
||||
|
||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||
const today = new Date();
|
||||
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
// 쿠키에서 마지막 alert 날짜 확인
|
||||
const lastAlertDate = getCookie('lastAlertDate');
|
||||
const todayDateString = today.toISOString().split('T')[0];
|
||||
if (lastAlertDate !== todayDateString &&
|
||||
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getDate() === lastDayOfMonth.getDate()) {
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||
{},
|
||||
function (response) {
|
||||
let dailyNo = []
|
||||
let msgTxt = '';
|
||||
let month = viewDate.getMonth() + 1;
|
||||
msgTxt += "등록하지 않은 일계부 항목이 있습니다.\n 정확한 조사를 위해 꾸준히 입력해 주세요.\n";
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
response.dailyRecordAlertDtoList.forEach((dto) =>{
|
||||
let dateTxt;
|
||||
if(dto.startDay === dto.endDay){
|
||||
dateTxt = month+"월 "+dto.startDay+"일";
|
||||
}else{
|
||||
dateTxt = month+"월 "+dto.startDay+"~"+dto.endDay+"일";
|
||||
}
|
||||
dailyNo.push(dateTxt);
|
||||
});
|
||||
msgTxt += "1. 일계부 미등록 \n"+dailyNo.join(',')+"\n";
|
||||
}
|
||||
|
||||
if(response.monthRecordAlertDtoList.length > 0) {
|
||||
response.monthRecordAlertDtoList.forEach((dto,idx) => {
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
idx ++;
|
||||
}
|
||||
msgTxt += idx+". "+dto+"\n";
|
||||
});
|
||||
}
|
||||
|
||||
if(response.dailyRecordAlertDtoList.length > 0 || dto.monthRecordAlertDtoList.length > 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: msgTxt,
|
||||
type:'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
function (rstData, status) {
|
||||
|
||||
},
|
||||
'get'
|
||||
,'json'
|
||||
);
|
||||
}
|
||||
},
|
||||
recordCreate(searchMonth, groupNo) {
|
||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
|
||||
},
|
||||
};
|
||||
|
||||
// 쿠키 설정 함수
|
||||
function setCookie(name, value, days) {
|
||||
const expires = new Date();
|
||||
expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/`;
|
||||
}
|
||||
|
||||
// 쿠키 가져오기 함수
|
||||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
@@ -818,6 +902,16 @@
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{if no == 1}}
|
||||
<li>
|
||||
<p class="label">월초이월금</p>
|
||||
{{if carryOver == null}}
|
||||
<p class="value">계산중입니다.</p>
|
||||
{{else}}
|
||||
<p class="value"><em><b>{{:carryOver}}</b> 원</em></p>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
{{for list ~edit=modifiable}}
|
||||
{{if status == null}}
|
||||
<li>
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
<div class="component-input">
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">수입</span>
|
||||
<!-- TODO : DONE 유지여부 판단하기 -->
|
||||
<input type="checkbox" name="incomeStatus" value="TARGET" data-target="income"
|
||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TARGET') or #strings.equals(dailyRecord.incomeStatus, 'DONE')}">
|
||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TARGET') or #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
@@ -44,7 +43,7 @@
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">임업노동 투입</span>
|
||||
<input type="checkbox" name="workStatus" value="TARGET" data-target="work"
|
||||
th:checked="${#strings.equals(dailyRecord.workStatus, 'TARGET') or #strings.equals(dailyRecord.workStatus, 'DONE')}">
|
||||
th:checked="${#strings.equals(dailyRecord.workStatus, 'TARGET') or #strings.equals(dailyRecord.workStatus, 'TODAY_NONE')}">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
@@ -54,7 +53,7 @@
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">지출</span>
|
||||
<input type="checkbox" name="expenseStatus" value="TARGET" data-target="expense"
|
||||
th:checked="${#strings.equals(dailyRecord.expenseStatus, 'TARGET') or #strings.equals(dailyRecord.expenseStatus, 'DONE')}">
|
||||
th:checked="${#strings.equals(dailyRecord.expenseStatus, 'TARGET') or #strings.equals(dailyRecord.expenseStatus, 'TODAY_NONE')}">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
@@ -64,7 +63,7 @@
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">동력 사용시간</span>
|
||||
<input type="checkbox" name="powerStatus" value="TARGET" data-target="power"
|
||||
th:checked="${#strings.equals(dailyRecord.powerStatus, 'TARGET') or #strings.equals(dailyRecord.powerStatus, 'DONE')}">
|
||||
th:checked="${#strings.equals(dailyRecord.powerStatus, 'TARGET') or #strings.equals(dailyRecord.powerStatus, 'TODAY_NONE')}">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
@@ -74,7 +73,7 @@
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">임업생산물 중 자가소비량</span>
|
||||
<input type="checkbox" name="forestryStatus" value="TARGET" data-target="forestry"
|
||||
th:checked="${#strings.equals(dailyRecord.forestryStatus, 'TARGET') or #strings.equals(dailyRecord.forestryStatus, 'DONE')}">
|
||||
th:checked="${#strings.equals(dailyRecord.forestryStatus, 'TARGET') or #strings.equals(dailyRecord.forestryStatus, 'TODAY_NONE')}">
|
||||
<span class="switch-item">
|
||||
<span class="switch-handle"></span>
|
||||
</span>
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
<div class="component-btns type-tab"
|
||||
th:if="not ${detail.updated}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn active">수기 등록</button>
|
||||
<!--/* TODO : 2차 오픈 */-->
|
||||
<!--<button type="button" class="btn">영수증 등록</button>-->
|
||||
<button type="button" id="btnSelf" class="btn active" onclick="modalControl.changeModal('self')">수기 등록</button>
|
||||
<button type="button" id="btnOcr" class="btn" onclick="modalControl.changeModal('ocr')">영수증 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,157 +16,199 @@
|
||||
<form name="reqModalForm">
|
||||
<input type="hidden" name="inputType" th:value="${#strings.defaultString(detail.inputType, 'SELF')}">
|
||||
<input type="hidden" name="id" th:value="${detail.id}">
|
||||
<section class="form-group">
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
외상 또는 카드 구입 여부
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-segment">
|
||||
<div class="component-radio">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" name="credit" value="true" th:checked="${detail.credit}">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">예</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="component-radio">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" name="credit" value="false" th:checked="not ${detail.credit}">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">아니오</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="expenseKind" class="label-txt">
|
||||
지출의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="expenseKind" name="expenseKind" th:value="${detail.expenseKind}" maxlength="30" placeholder="지출의 종류를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="sourcePurpose" class="label-txt">
|
||||
용도
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="용도를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="quantity" class="label-txt">
|
||||
수량
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
|
||||
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 2, 2.5</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="select-group">
|
||||
<div class="select-label">
|
||||
<p class="label-txt">
|
||||
단위
|
||||
</p>
|
||||
</div>
|
||||
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
|
||||
<input type="hidden" name="unitCode" data-type="select" th:value="${detail.unitCode}">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
<div class="select-options">
|
||||
<div class="select-header">
|
||||
<p>단위</p>
|
||||
<button type="button" class="select-close">
|
||||
<span class="hide-txt">닫기</span>
|
||||
</button>
|
||||
<!--/* 수기 등록 s */-->
|
||||
<div id="modelSelf">
|
||||
<section class="form-group">
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
외상 또는 카드 구입 여부
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-segment">
|
||||
<div class="component-radio">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" name="credit" value="true" th:checked="${detail.credit}">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">예</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" th:each="uiCode : ${recordUnit}"
|
||||
th:data-value="${uiCode.id}"
|
||||
th:text="${uiCode.codeText}"
|
||||
th:selected="${uiCode.id eq detail.unitCode ? 'current' : ''}"
|
||||
></li>
|
||||
<div class="component-radio">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" name="credit" value="false" th:checked="not ${detail.credit}">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">아니오</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="expenseKind" class="label-txt">
|
||||
지출의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="expenseKind" name="expenseKind" th:value="${detail.expenseKind}" maxlength="30" placeholder="지출의 종류를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="sourcePurpose" class="label-txt">
|
||||
용도
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="용도를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="quantity" class="label-txt">
|
||||
수량
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
|
||||
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 2, 2.5</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="select-group">
|
||||
<div class="select-label">
|
||||
<p class="label-txt">
|
||||
단위
|
||||
</p>
|
||||
</div>
|
||||
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
|
||||
<input type="hidden" name="unitCode" data-type="select" th:value="${detail.unitCode}">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
<div class="select-options">
|
||||
<div class="select-header">
|
||||
<p>단위</p>
|
||||
<button type="button" class="select-close">
|
||||
<span class="hide-txt">닫기</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" th:each="uiCode : ${recordUnit}"
|
||||
th:data-value="${uiCode.id}"
|
||||
th:text="${uiCode.codeText}"
|
||||
th:selected="${uiCode.id eq detail.unitCode ? 'current' : ''}"
|
||||
></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="price" class="label-txt">
|
||||
현금
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-price">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" min="1" max="9999999999"
|
||||
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||
<span class="input-field-txt">원</span>
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 30000</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="estimatedValue" class="label-txt">
|
||||
현물평가액
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-price">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
|
||||
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||
<span class="input-field-txt">원</span>
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 30000</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="modalControl.createVaild();">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* 수기 등록 e */-->
|
||||
<!--/* 영수증 등록 s */-->
|
||||
<div id="modelOcr" style="display: none;">
|
||||
<section class="form-group">
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
영수증 첨부
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-segment">
|
||||
<div class="component-file">
|
||||
<div class="file-list" id="file-upload-container">
|
||||
</div>
|
||||
<button type="button" class="btn btn-m btn-link btn-full" onclick="modalControl.addFileInput();">
|
||||
<i class="ico-add ico-small" aria-hidden="true"></i>
|
||||
<span class="btn-txt">사진 첨부</span>
|
||||
</button>
|
||||
<ul class="guide-info">
|
||||
<li>영수증은 일일 최대 3개 등록하실 수 있습니다.</li>
|
||||
<li>
|
||||
최대 갯수 등록 후에는 수기 입력만 가능합니다. <br>
|
||||
(사진 1개당 5MB 이하)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
|
||||
</section>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<!-- 버튼비활성 스타일 속성에 disabled 추가 -->
|
||||
<button type="button" onclick="modalControl.onSubmitReceiptFile();" class="btn btn-full btn-l btn-primary">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="price" class="label-txt">
|
||||
현금
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-price">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" min="1" max="9999999999"
|
||||
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||
<span class="input-field-txt">원</span>
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 30000</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="estimatedValue" class="label-txt">
|
||||
현물평가액
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-price">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
|
||||
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||
<span class="input-field-txt">원</span>
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 30000</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="modalControl.createVaild();">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* 영수증 등록 e */-->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -148,6 +148,8 @@
|
||||
create: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||
remove: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
reset: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||
receipt: /*[[|/api/record/receipt|]]*/'receiptUrl',
|
||||
receiptCreate: /*[[|/api/record/receipt/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'receiptCreateUrl',
|
||||
},
|
||||
modal: {
|
||||
// 등록 버튼
|
||||
@@ -165,6 +167,7 @@
|
||||
krip.daily.baseBindUI();
|
||||
},
|
||||
};
|
||||
let uploadedReceipt =[];
|
||||
|
||||
let modalControl = {
|
||||
_bindModelUI() {
|
||||
@@ -215,6 +218,19 @@
|
||||
$input.val('').attr('disabled', true);
|
||||
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
||||
},
|
||||
changeModal(type) {
|
||||
if (type === 'self') {
|
||||
$('#modelSelf').show();
|
||||
$('#btnSelf').addClass('active');
|
||||
$('#modelOcr').hide();
|
||||
$('#btnOcr').removeClass('active');
|
||||
} else {
|
||||
$('#modelSelf').hide();
|
||||
$('#btnSelf').removeClass('active');
|
||||
$('#modelOcr').show();
|
||||
$('#btnOcr').addClass('active');
|
||||
}
|
||||
},
|
||||
createVaild() {
|
||||
modalControl.create();
|
||||
},
|
||||
@@ -232,6 +248,224 @@
|
||||
},
|
||||
);
|
||||
},
|
||||
addFileInput() {
|
||||
// 새로운 input type="file" 요소 생성
|
||||
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');
|
||||
|
||||
if (files.length === 0) {
|
||||
const para = document.createElement('p');
|
||||
para.textContent = '선택된 파일이 없습니다.';
|
||||
para.classList.add('error');
|
||||
previewContainer.append(para);
|
||||
return;
|
||||
}
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
if (!file.type.startsWith('image/')) {
|
||||
const para = document.createElement('p');
|
||||
para.textContent = `파일 ${file.name}: 유효한 이미지 파일이 아닙니다.`;
|
||||
para.classList.add('error');
|
||||
previewContainer.append(para);
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
ajaxUtil._showWaiting();
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: ENV.httpUrl.receipt,
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
enctype: 'multipart/form-data',
|
||||
beforeSend: function(xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content")
|
||||
);
|
||||
},
|
||||
success(res) {
|
||||
// 썸네일 생성
|
||||
const imgSrc = URL.createObjectURL(file);
|
||||
const fileItemId = `file-item-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const fileItem = $(`
|
||||
<div class="file-item" id="${fileItemId}">
|
||||
<img class="profile-image-add" src="${imgSrc}" alt="${file.name}"/>
|
||||
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
|
||||
</div>
|
||||
`);
|
||||
previewContainer.append(fileItem);
|
||||
|
||||
// 파일 정보와 서버 응답 저장
|
||||
uploadedReceipt.push({
|
||||
fileId: fileItemId,
|
||||
file: file,
|
||||
receiptResVO: res
|
||||
});
|
||||
|
||||
// 삭제 버튼 이벤트 추가
|
||||
fileItem.find('.btn-delete').on('click', function() {
|
||||
modalControl.deleteFile(fileItemId);
|
||||
fileItem.remove()
|
||||
});
|
||||
ajaxUtil._hideWaiting();
|
||||
},
|
||||
error: function(xhr) {
|
||||
const resJson = xhr.responseJSON || {};
|
||||
const errorMessage = resJson.error || `HTTP ${xhr.status}: 요청 처리 중 오류가 발생했습니다.`;
|
||||
console.error('영수증 업로드 실패:', xhr, errorMessage);
|
||||
|
||||
etUI.dialog.alert({
|
||||
title: '영수증 업로드 실패',
|
||||
message: '정상적으로 인식되지 않은 사진이 있습니다. 정확한 사진을 첨부해주세요.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
fileInput.value = '';
|
||||
},
|
||||
});
|
||||
ajaxUtil._hideWaiting();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 입력 필드 초기화
|
||||
fileInput.value = '';
|
||||
const container = document.getElementById('file-upload-container');
|
||||
container.appendChild(fileInput);
|
||||
|
||||
// 파일 선택 창 열기
|
||||
fileInput.click();
|
||||
},
|
||||
deleteFile(fileItemId) {
|
||||
const index = uploadedReceipt.findIndex(item => item.fileId === fileItemId);
|
||||
if (index !== -1) {
|
||||
URL.revokeObjectURL(uploadedReceipt[index].imgSrc); // 메모리 해제
|
||||
$(`#${fileItemId}`).remove();
|
||||
uploadedReceipt.splice(index, 1);
|
||||
}
|
||||
},
|
||||
onSubmitReceiptFile(){
|
||||
const receiptDataList = uploadedReceipt;
|
||||
if (!receiptDataList.length) {
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '등록할 영수증 데이터가 없습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const f = document.reqModalForm;
|
||||
|
||||
let formData = new FormData();
|
||||
|
||||
const reqVOList = receiptDataList.map(item => ({
|
||||
file: { name: item.file.name },
|
||||
fileUploadType: 'EXPENSE',
|
||||
ocr: item.receiptResVO
|
||||
}));
|
||||
receiptDataList.forEach(item => {
|
||||
formData.append('file', item.file);
|
||||
});
|
||||
formData.append('reqVO', new Blob([JSON.stringify(reqVOList)], { type: 'application/json' }));
|
||||
|
||||
ajaxUtil._showWaiting();
|
||||
|
||||
console.log("receiptDataList",receiptDataList);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: ENV.httpUrl.receiptCreate.replace('{id}', f.id.value ? f.id.value : '0'),
|
||||
data: formData,
|
||||
contentType: false, // * 중요 *
|
||||
processData: false, // * 중요 *
|
||||
enctype: 'multipart/form-data', // * 중요 *
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
etUI.dialog.alert({
|
||||
title: '등록',
|
||||
message: '영수증이 성공적으로 등록되었습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
statusCode: {
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON || {};
|
||||
const errorMessage = resJson.error || '잘못된 요청입니다.';
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
500: function (res) {
|
||||
const resJson = res.responseJSON || {};
|
||||
const errorMessage = resJson.error || '서버 오류가 발생했습니다.';
|
||||
console.log(`서버 오류: ${errorMessage}`);
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
error: function (xhr) {
|
||||
const errorMessage = xhr.responseJSON?.error || `HTTP ${xhr.status}`;
|
||||
console.log(`영수증 업로드 실패: ${errorMessage}`);
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ajaxUtil._hideWaiting();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<div class="component-btns type-tab"
|
||||
th:if="not ${detail.updated}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn active" onclick="modalControl.changeModal('self')">수기 등록</button>
|
||||
<button type="button" id="btnSelf" class="btn active" onclick="modalControl.changeModal('self')">수기 등록</button>
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<button type="button" class="btn" onclick="modalControl.changeModal('ocr')">영수증 등록</button>
|
||||
<button type="button" id="btnOcr" class="btn" onclick="modalControl.changeModal('ocr')">영수증 등록</button>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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">
|
||||
영수증 첨부
|
||||
@@ -214,21 +215,9 @@
|
||||
</div>
|
||||
<div class="component-segment">
|
||||
<div class="component-file">
|
||||
<div class="file-list">
|
||||
<div class="file-item">
|
||||
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
|
||||
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
|
||||
</div>
|
||||
<div class="file-item">
|
||||
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
|
||||
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
|
||||
</div>
|
||||
<div class="file-item">
|
||||
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
|
||||
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
|
||||
</div>
|
||||
<div class="file-list" id="file-upload-container">
|
||||
</div>
|
||||
<button type="button" class="btn btn-m btn-link btn-full">
|
||||
<button type="button" class="btn btn-m btn-link btn-full" onclick="modalControl.addFileInput();">
|
||||
<i class="ico-add ico-small" aria-hidden="true"></i>
|
||||
<span class="btn-txt">사진 첨부</span>
|
||||
</button>
|
||||
@@ -246,7 +235,7 @@
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<!-- 버튼비활성 스타일 속성에 disabled 추가 -->
|
||||
<button type="button" class="btn btn-full btn-l btn-primary">
|
||||
<button type="button" onclick="modalControl.onSubmitReceiptFile();" class="btn btn-full btn-l btn-primary">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -162,6 +162,8 @@
|
||||
create: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||
remove: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
reset: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||
receipt: /*[[|/api/record/receipt|]]*/'receiptUrl',
|
||||
receiptCreate: /*[[|/api/record/receipt/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'receiptCreateUrl',
|
||||
},
|
||||
modal: {
|
||||
// 등록 버튼
|
||||
@@ -179,7 +181,7 @@
|
||||
krip.daily.baseBindUI();
|
||||
},
|
||||
};
|
||||
|
||||
let uploadedReceipt =[];
|
||||
let modalControl = {
|
||||
_bindModelUI() {
|
||||
const $select1 = document.querySelector('#cropCode');
|
||||
@@ -242,10 +244,39 @@
|
||||
changeModal(type) {
|
||||
if (type === 'self') {
|
||||
$('#modelSelf').show();
|
||||
$('#btnSelf').addClass('active');
|
||||
$('#modelOcr').hide();
|
||||
$('#btnOcr').removeClass('active');
|
||||
} else {
|
||||
$('#modelSelf').hide();
|
||||
$('#modelOcr').show();
|
||||
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() {
|
||||
@@ -265,6 +296,236 @@
|
||||
},
|
||||
);
|
||||
},
|
||||
addFileInput() {
|
||||
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');
|
||||
|
||||
if (files.length === 0) {
|
||||
const para = document.createElement('p');
|
||||
para.textContent = '선택된 파일이 없습니다.';
|
||||
para.classList.add('error');
|
||||
previewContainer.append(para);
|
||||
return;
|
||||
}
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
if (!file.type.startsWith('image/')) {
|
||||
const para = document.createElement('p');
|
||||
para.textContent = `파일 ${file.name}: 유효한 이미지 파일이 아닙니다.`;
|
||||
para.classList.add('error');
|
||||
previewContainer.append(para);
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
ajaxUtil._showWaiting();
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/api/record/receipt',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
enctype: 'multipart/form-data',
|
||||
beforeSend: function(xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content")
|
||||
);
|
||||
},
|
||||
success(res) {
|
||||
// 썸네일 생성
|
||||
const imgSrc = URL.createObjectURL(file);
|
||||
const fileItemId = `file-item-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const fileItem = $(`
|
||||
<div class="file-item" id="${fileItemId}">
|
||||
<img class="profile-image-add" src="${imgSrc}" alt="${file.name}"/>
|
||||
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
|
||||
</div>
|
||||
`);
|
||||
previewContainer.append(fileItem);
|
||||
|
||||
uploadedReceipt.push({
|
||||
fileId: fileItemId,
|
||||
file: file,
|
||||
receiptResVO: res
|
||||
});
|
||||
|
||||
// 삭제 버튼 이벤트 추가
|
||||
fileItem.find('.btn-delete').on('click', function() {
|
||||
modalControl.deleteFile(fileItemId);
|
||||
fileItem.remove()
|
||||
});
|
||||
ajaxUtil._hideWaiting();
|
||||
},
|
||||
error: function(xhr) {
|
||||
const resJson = xhr.responseJSON || {};
|
||||
const errorMessage = resJson.error || `HTTP ${xhr.status}: 요청 처리 중 오류가 발생했습니다.`;
|
||||
console.error('영수증 업로드 실패:', xhr, errorMessage);
|
||||
|
||||
etUI.dialog.alert({
|
||||
title: '영수증 업로드 실패',
|
||||
message: '정상적으로 인식되지 않은 사진이 있습니다. 정확한 사진을 첨부해주세요.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
fileInput.value = '';
|
||||
},
|
||||
});
|
||||
ajaxUtil._hideWaiting();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 입력 필드 초기화
|
||||
fileInput.value = '';
|
||||
const container = document.getElementById('file-upload-container');
|
||||
container.appendChild(fileInput);
|
||||
|
||||
// 파일 선택 창 열기
|
||||
fileInput.click();
|
||||
},
|
||||
deleteFile(fileItemId) {
|
||||
const index = uploadedReceipt.findIndex(item => item.fileId === fileItemId);
|
||||
if (index !== -1) {
|
||||
URL.revokeObjectURL(uploadedReceipt[index].imgSrc); // 메모리 해제
|
||||
$(`#${fileItemId}`).remove();
|
||||
uploadedReceipt.splice(index, 1);
|
||||
}
|
||||
},
|
||||
onSubmitReceiptFile(){
|
||||
const receiptDataList = uploadedReceipt;
|
||||
if (!receiptDataList.length) {
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: '최소 1개의 영수증을 등록해주셔야 합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const f = document.reqModalForm;
|
||||
|
||||
let formData = new FormData();
|
||||
|
||||
const reqVOList = receiptDataList.map(item => ({
|
||||
file: { name: item.file.name },
|
||||
fileUploadType: 'INCOME',
|
||||
ocr: item.receiptResVO
|
||||
}));
|
||||
receiptDataList.forEach(item => {
|
||||
formData.append('file', item.file);
|
||||
});
|
||||
formData.append('reqVO', new Blob([JSON.stringify(reqVOList)], { type: 'application/json' }));
|
||||
|
||||
ajaxUtil._showWaiting();
|
||||
|
||||
console.log("receiptDataList",receiptDataList);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: ENV.httpUrl.receiptCreate.replace('{id}', f.id.value ? f.id.value : '0'),
|
||||
data: formData,
|
||||
contentType: false, // * 중요 *
|
||||
processData: false, // * 중요 *
|
||||
enctype: 'multipart/form-data', // * 중요 *
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
etUI.dialog.alert({
|
||||
title: '등록',
|
||||
message: '영수증이 성공적으로 등록되었습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
statusCode: {
|
||||
400: function (res) {
|
||||
const resJson = res.responseJSON || {};
|
||||
const errorMessage = resJson.error || '잘못된 요청입니다.';
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
500: function (res) {
|
||||
const resJson = res.responseJSON || {};
|
||||
const errorMessage = resJson.error || '서버 오류가 발생했습니다.';
|
||||
console.log(`서버 오류: ${errorMessage}`);
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
error: function (xhr) {
|
||||
const errorMessage = xhr.responseJSON?.error || `HTTP ${xhr.status}`;
|
||||
console.log(`영수증 업로드 실패: ${errorMessage}`);
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '영수증이 등록 실패하였습니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
// 초기화
|
||||
uploadedReceipt.forEach(item => URL.revokeObjectURL(item.imgSrc));
|
||||
uploadedReceipt.length = 0;
|
||||
$('#file-upload-container').empty();
|
||||
location.reload();
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ajaxUtil._hideWaiting();
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
167
front/src/main/resources/templates/status/daily.html
Normal file
167
front/src/main/resources/templates/status/daily.html
Normal file
@@ -0,0 +1,167 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<main id="content" role="main">
|
||||
<section class="month-filter">
|
||||
<div class="inner">
|
||||
<div id="searchMonth" class="component-select bottom-sheet" data-props-type="bottomSheet">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
<div class="select-options">
|
||||
<div class="select-header">
|
||||
<p>월 선택</p>
|
||||
<button type="button" class="select-close">
|
||||
<span class="hide-txt">닫기</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option"
|
||||
th:each="item, itemStatus : ${reqVO.monthList}"
|
||||
th:classappend="${#strings.equals(reqVO.searchMonth, #temporals.format(item, 'yyyyMM'))} ? 'current'"
|
||||
th:data-value="${#temporals.format(item, 'yyyyMM')}"
|
||||
th:text="${#temporals.format(item, 'yyyy년 M월')}"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="summary">
|
||||
<li>
|
||||
<span>작성일</span>
|
||||
<p><strong>[[${detail.doneCount}]]</strong>일</p>
|
||||
</li>
|
||||
<li>
|
||||
<span>미작성일</span>
|
||||
<p><strong>[[${detail.dayCount - detail.doneCount}]]</strong>일</p>
|
||||
</li>
|
||||
<li>
|
||||
<span>총 등록</span>
|
||||
<p><strong>[[${#numbers.formatInteger(detail.totalInput, 1, 'COMMA')}]]</strong>건</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="month-detail bg-gray bg-lround"
|
||||
th:unless="${#lists.isEmpty(detail.itemList)}">
|
||||
<div class="inner">
|
||||
<p class="tit">항목별 월간 현황</p>
|
||||
<ul class="btn-column-list">
|
||||
<th:block th:each="item, itemStatus : ${detail.itemList}">
|
||||
<li th:classappend="${item.inputCount != 0} ? 'view'">
|
||||
<th:block th:if="${item.inputCount != 0}">
|
||||
<a href="javascript:void(0);" th:onclick="formControl.detailModal([[${#strings.toLowerCase(item.step.name)}]], [[${#strings.toLowerCase(item.step.desc2)}]])">
|
||||
</th:block>
|
||||
<p class="label">[[${item.step.desc2}]]</p>
|
||||
<ul class="value">
|
||||
<li>
|
||||
<span>작성일</span>
|
||||
<span>[[${item.doneCount}]]일</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>등록 건수</span>
|
||||
<span>[[${item.inputCount}]]건</span>
|
||||
</li>
|
||||
|
||||
<li class="total"
|
||||
th:if="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).WORK)}">
|
||||
<span>총 투입 시간</span>
|
||||
<span><strong>[[${@dailyUtil.getStringComma(item.totalValue)}]]</strong>시간</span>
|
||||
</li>
|
||||
<li class="total"
|
||||
th:if="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).POWER)}">
|
||||
<span>총 사용 시간</span>
|
||||
<span><strong>[[${@dailyUtil.getStringComma(item.totalValue)}]]</strong>시간</span>
|
||||
</li>
|
||||
<li class="total"
|
||||
th:unless="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).WORK)
|
||||
or #strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).POWER)}">
|
||||
<span>총 금액</span>
|
||||
<span><strong>[[${#numbers.formatInteger(item.totalValue, 1, 'COMMA')}]]</strong>원</span>
|
||||
</li>
|
||||
</ul>
|
||||
<th:block th:if="${item.inputCount != 0}">
|
||||
</a>
|
||||
</th:block>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal regi-wrap detailModal" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit"></h3>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<!--/* detail */-->
|
||||
</div>
|
||||
<button type="button" class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //모달 팝업 -->
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[${currentURI?.uri}]]*/'',
|
||||
detail: /*[[|${currentURI?.uri}/{step}/{month}|]]*/'',
|
||||
},
|
||||
modal: {
|
||||
// 등록 영역
|
||||
selector: '.detailModal',
|
||||
},
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
init() {
|
||||
this._bindUI();
|
||||
},
|
||||
_bindUI() {
|
||||
const $select1 = document.querySelector('#searchMonth');
|
||||
const selectboxInstance1 = $select1.ui;
|
||||
selectboxInstance1.core.init($select1, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
location.href = ENV.httpUrl.root + '?searchMonth=' + dataValue;
|
||||
}
|
||||
});
|
||||
},
|
||||
detailModal(step, desc) {
|
||||
ajaxUtil._ajaxAsyncMethod(
|
||||
ENV.httpUrl.detail.replace('{step}', step).replace('{month}', ENV.month),
|
||||
{},
|
||||
function(rstHtml, status) {
|
||||
$(ENV.modal.selector).find('.modal-tit').html(desc + ' 내역');
|
||||
$(ENV.modal.selector).find('.modal-content').html(rstHtml);
|
||||
|
||||
const modal01 = document.querySelector(ENV.modal.selector).ui;
|
||||
modal01.open();
|
||||
},
|
||||
function(code, rstData) {
|
||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||
},
|
||||
'get',
|
||||
'html'
|
||||
);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.expenseKind}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${item.credit != null}">
|
||||
<p>외상 또는 카드 구입 여부</p>
|
||||
<span th:text="${item.credit ? '예' : '아니오'}">아니오</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.sourcePurpose)}">
|
||||
<p>용도</p>
|
||||
<span th:text="${item.sourcePurpose}">소비자</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||
<p>수량</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.price)}">
|
||||
<p>현금 </p>
|
||||
<span th:text="|${#numbers.formatInteger(item.price, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||
<p>현물평가액</p>
|
||||
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productLabel}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${not #strings.isEmpty(item.usage)}">
|
||||
<p>용도</p>
|
||||
<span th:text="${item.usage}">0시간</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||
<p>수량</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||
<p>현물평가액</p>
|
||||
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productName}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${not #strings.isEmpty(item.usage)}">
|
||||
<p>용도</p>
|
||||
<span th:text="${item.usage}">0시간</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||
<p>수량</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||
<p>현물평가액</p>
|
||||
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.incomeKind}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${item.credit != null}">
|
||||
<p>외상판매</p>
|
||||
<span th:text="${item.credit ? '예' : '아니오'}">아니오</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.cropLabel)}">
|
||||
<p>재배형태</p>
|
||||
<span th:text="${item.cropLabel}">재배형태</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.sourcePurpose)}">
|
||||
<p>수입원</p>
|
||||
<span th:text="${item.sourcePurpose}">소비자</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||
<p>수량</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.price)}">
|
||||
<p>현금 </p>
|
||||
<span th:text="|${#numbers.formatInteger(item.price, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||
<p>현물평가액</p>
|
||||
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.equipmentName}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${not #strings.isEmpty(item.ownedHours)}">
|
||||
<p>자가 사용시간</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.ownedHours)}시간|">0시간</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.leasedHours)}">
|
||||
<p>임차 사용시간</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.leasedHours)}시간|">0시간</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||
<div class="modal-content-inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
<section class="regist-item-area"
|
||||
th:unless="${#lists.isEmpty(list)}">
|
||||
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||
<p class="month-tit">
|
||||
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||
</th:block>
|
||||
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||
</th:block>
|
||||
</p>
|
||||
|
||||
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${recordItem.children}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.itemName}]]</p>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${not #strings.isEmpty(item.workName)}">
|
||||
<p>작업명</p>
|
||||
<span th:text="${item.workName}">수확</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.workLandArea)}">
|
||||
<p>작업 면적</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.workLandArea)}${#strings.defaultString(item.areaUnitLabel,'')}|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.harvestQuantity)}">
|
||||
<p>수확량</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.harvestQuantity)}${#strings.defaultString(item.harvestUnitLabel,'')}|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.ownerTime)}">
|
||||
<p>경영주 노동투입시간</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.ownerTime)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.spouseTime)}">
|
||||
<p>배우자 노동투입시간</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.spouseTime)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.familyMHours)}">
|
||||
<p>가족노동(남)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.familyMHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.familyFHours)}">
|
||||
<p>가족노동(여)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.familyFHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.hiredMHours)}">
|
||||
<p>고용노동(남)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.hiredMHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.hiredFHours)}">
|
||||
<p>고용노동(여)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.hiredFHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.sharedMHours)}">
|
||||
<p>품앗이(남)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.sharedMHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.sharedFHours)}">
|
||||
<p>품앗이(여)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.sharedFHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.volunteerMHours)}">
|
||||
<p>일손돕기(남)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.volunteerMHours)}시간|"></span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.volunteerFHours)}">
|
||||
<p>일손돕기(여)</p>
|
||||
<span th:text="|${@dailyUtil.getStringComma(item.volunteerFHours)}시간|"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||
</th:block>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user