[FO] 일계부 등록 wip, FrontAuditCommand 커밋 누락
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package app.module.front.config.adapters.persistence.component;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.config.application.security.FrontHouseholdUser;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class FrontAuditCommand {
|
||||
private Long householdSeq;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
private LocalDateTime deletedAt;
|
||||
private String deletedBy;
|
||||
|
||||
public void create() {
|
||||
this.householdSeq = getCurrentUserSeq();
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.createdBy = getCurrentUsername();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
this.updatedBy = getCurrentUsername();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
this.householdSeq = getCurrentUserSeq();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
this.updatedBy = getCurrentUsername();
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
this.householdSeq = getCurrentUserSeq();
|
||||
this.deletedAt = LocalDateTime.now();
|
||||
this.deletedBy = getCurrentUsername();
|
||||
}
|
||||
|
||||
private Long getCurrentUserSeq() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
|
||||
Object principal = authentication.getPrincipal();
|
||||
Long userseq = null;
|
||||
|
||||
if (principal instanceof UserDetails) {
|
||||
userseq = ((FrontHouseholdUser) principal).getHouseholdSeq();
|
||||
}
|
||||
|
||||
return userseq;
|
||||
}
|
||||
|
||||
private String getCurrentUsername() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
|
||||
return authentication != null && authentication.isAuthenticated()
|
||||
? CommonUtil.getLoginUsername() : "INIT_DATA";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.front.usecase.daily.income.application.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyIncomeCmd {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private Boolean isCredit;
|
||||
private String cropCode;
|
||||
// TODO : 수입종류의 코드맵핑 여부 판단
|
||||
private String categoryCode;
|
||||
private String categoryName;
|
||||
private String sourcePurpose;
|
||||
// TODO : 타입
|
||||
private String quantity;
|
||||
private String unitCode;
|
||||
private Integer price;
|
||||
private Integer estimatedValue;
|
||||
// TODO : 무슨 데이터 넣을 것인가?
|
||||
private String createdBy;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package app.module.front.usecase.daily.income.persistence;
|
||||
|
||||
import app.module.front.usecase.daily.income.application.model.DailyIncomeCmd;
|
||||
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DailyIncomeMapper {
|
||||
/**
|
||||
* 수입내역 데이터 존재 여부
|
||||
* @param householdSeq
|
||||
* @param recordMonth
|
||||
* @param dayGroupNo
|
||||
* @return
|
||||
*/
|
||||
Long getDailyIncomeExistCount(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
||||
|
||||
/**
|
||||
* 수입내역 목록 조회
|
||||
* @param householdSeq
|
||||
* @param recordMonth
|
||||
* @param dayGroupNo
|
||||
* @return
|
||||
*/
|
||||
List<DailyIncomeDto> getDailyIncomeList(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
||||
|
||||
/**
|
||||
* 수입내역 단건 조회
|
||||
* @param householdSeq
|
||||
* @param recordMonth
|
||||
* @param dayGroupNo
|
||||
* @return
|
||||
*/
|
||||
DailyIncomeDto getDailyIncome(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
||||
|
||||
/**
|
||||
* 수입내역 등록
|
||||
* @param command
|
||||
* @return
|
||||
*/
|
||||
Long createDailyIncome(DailyIncomeCmd command);
|
||||
|
||||
/**
|
||||
* 수입내역 수정
|
||||
* @param command
|
||||
* @return
|
||||
*/
|
||||
int updateDailyIncome(DailyIncomeCmd command);
|
||||
|
||||
/**
|
||||
* 수입내역 삭제
|
||||
* @return
|
||||
*/
|
||||
int removeDailyIncome();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.module.front.usecase.daily.income.persistence.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyIncomeDto {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private Boolean isCredit;
|
||||
// TODO
|
||||
private String createdBy;
|
||||
private LocalDateTime createdAt;
|
||||
private Integer price;
|
||||
private Integer estimatedValue;
|
||||
private String updatedBy;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.income.web;
|
||||
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
||||
@@ -18,14 +19,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
public class DailyIncomeController {
|
||||
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model
|
||||
, @PathVariable(required = true) String searchMonth
|
||||
, @PathVariable(required = true) String groupNo) {
|
||||
public String index(Model model,
|
||||
@PathVariable(required = true) String searchMonth,
|
||||
@PathVariable(required = true) String groupNo) {
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO();
|
||||
reqVO.setSearchMonth(searchMonth);
|
||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
reqVO.setHouseholdSeq(getAccessId());
|
||||
reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
@@ -33,9 +34,4 @@ public class DailyIncomeController {
|
||||
|
||||
return "record/income/index";
|
||||
}
|
||||
|
||||
// TODO : 로그인 SEQ
|
||||
private Long getAccessId() {
|
||||
return 2L;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.record.service;
|
||||
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.usecase.daily.record.persistence.DailyRecordMapper;
|
||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
||||
@@ -67,6 +68,6 @@ public class DailyRecordServiceImpl implements DailyRecordService {
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecordMapper.createDailyRecord(command);
|
||||
dailyRecordMapper.createDailyRecord(AuditUtil.create(command));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.record.web;
|
||||
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
||||
@@ -33,7 +34,7 @@ public class DailyRecordController {
|
||||
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO();
|
||||
reqVO.setSearchMonth(searchMonth);
|
||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
reqVO.setHouseholdSeq(getAccessId());
|
||||
reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
|
||||
//uiCodeListPortIn.connect("code.pageable.rows");
|
||||
@@ -60,7 +61,7 @@ public class DailyRecordController {
|
||||
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO();
|
||||
reqVO.setSearchMonth(searchMonth);
|
||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
reqVO.setHouseholdSeq(getAccessId());
|
||||
// reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
|
||||
//uiCodeListPortIn.connect("code.pageable.rows");
|
||||
@@ -79,9 +80,4 @@ public class DailyRecordController {
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||
}
|
||||
|
||||
// TODO : 로그인 SEQ
|
||||
private Long getAccessId() {
|
||||
return 2L;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package app.module.front.usecase.daily.record.web.model;
|
||||
|
||||
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CreateDailyRecordReqVO {
|
||||
public class CreateDailyRecordReqVO extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
// private Long householdSeq;
|
||||
private String recordMonth;
|
||||
private int dayGroupNo;
|
||||
private LocalDate startDate;
|
||||
@@ -25,5 +23,5 @@ public class CreateDailyRecordReqVO {
|
||||
private DailyTargetStatus powerStatus;
|
||||
private DailyTargetStatus forestryStatus;
|
||||
// TODO : 무슨 데이터 넣을 것인가?
|
||||
private String createdBy;
|
||||
// private String createdBy;
|
||||
}
|
||||
|
||||
73
front/src/main/resources/mappers/daily/DailyIncomeMapper.xml
Normal file
73
front/src/main/resources/mappers/daily/DailyIncomeMapper.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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.income.persistence.DailyIncomeMapper">
|
||||
|
||||
<select id="getDailyIncomeExistCount" resultType="int">
|
||||
select count(ds.*)
|
||||
from daily_income ds
|
||||
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
</select>
|
||||
|
||||
<select id="getDailyIncomeList">
|
||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by
|
||||
from daily_income
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
</select>
|
||||
|
||||
<select id="getDailyIncome">
|
||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by
|
||||
from daily_income
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
</select>
|
||||
|
||||
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_income (
|
||||
daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by, is_deleted
|
||||
) values (
|
||||
#{householdSeq}
|
||||
, #{isCredit}, #{cropCode}, #{categoryCode}, #{categoryName}, #{sourcePurpose}
|
||||
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
||||
, now(), #{createdBy}, false
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDailyIncome">
|
||||
update daily_income set
|
||||
updated_at = now()
|
||||
, updated_by = #{updatedBy}
|
||||
, is_credit = #{isCredit}
|
||||
, crop_code = #{cropCode}
|
||||
, category_code = #{categoryCode}
|
||||
, category_name = #{categoryName}
|
||||
, source_purpose = #{sourcePurpose}
|
||||
, quantity = #{quantity}
|
||||
, unit_code = #{unitCode}
|
||||
, price = #{price}
|
||||
, estimated_value = #{estimatedValue}
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
</update>
|
||||
|
||||
<update id="removeDailyIncome">
|
||||
update daily_income set
|
||||
deleted_at = now(),
|
||||
deleted_by = '_system',
|
||||
is_deleted = true
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -31,19 +31,19 @@
|
||||
insert into daily_record (
|
||||
household_seq, record_month, day_group_no, start_date, end_date
|
||||
, all_status, income_status, work_status, expense_status, power_status, forestry_status
|
||||
, created_at, created_by, is_deleted
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{householdSeq}
|
||||
, #{recordMonth}, #{dayGroupNo}, #{startDate}, #{endDate}
|
||||
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}
|
||||
, now(), #{createdBy}, false
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDailyRecordStatus">
|
||||
update daily_record set
|
||||
updated_at = now()
|
||||
, updated_by = #{updatedBy}
|
||||
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
||||
<if test="allStatus != null and allStatus != ''">
|
||||
, all_status = #{allStatus}
|
||||
</if>
|
||||
|
||||
@@ -8,4 +8,15 @@ uri.front.user.register=\uD68C\uC6D0\uAC00\uC785
|
||||
uri.front.user.info=\uC815\uBCF4\uC218\uC815
|
||||
uri.front.board.article.create=\uC608\uC81C \uAC8C\uC2DC\uD310 \uB4F1\uB85D
|
||||
uri.front.board.article.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC0C1\uC138\uBCF4\uAE30
|
||||
uri.front.board.article.update.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC218\uC815
|
||||
uri.front.board.article.update.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC218\uC815
|
||||
|
||||
# \uC77C\uACC4\uBD80
|
||||
uri.front.record.calendar=\uC77C\uACC4\uBD80 \uC6D4\uBCC4 \uD604\uD669
|
||||
uri.front.record.calendar.{{pathVar}}.{{pathVar}}=\uC77C\uACC4\uBD80 \uC6D4\uBCC4 \uD604\uD669
|
||||
uri.front.record.daily=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||
uri.front.record.daily.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||
uri.front.record.income.{{pathVar}}=\uC218\uC785\uB0B4\uC5ED \uB4F1\uB85D
|
||||
uri.front.record.expense.{{pathVar}}=\uC9C0\uCD9C\uB0B4\uC5ED \uB4F1\uB85D
|
||||
uri.front.record.work.{{pathVar}}=\uB178\uB3D9\uC2DC\uAC04 \uB4F1\uB85D
|
||||
uri.front.record.power.{{pathVar}}=\uB3D9\uB825 \uC0AC\uC6A9\uC2DC\uAC04 \uB4F1\uB85D
|
||||
uri.front.record.forestry.{{pathVar}}=\uC790\uAC00\uC784\uC5C5 \uC0DD\uC0B0\uBB3C \uC911 \uC790\uAC00\uC18C\uBE44\uB7C9 \uB4F1\uB85D
|
||||
|
||||
@@ -61,7 +61,7 @@ var ajaxUtil = {
|
||||
uxgFn.popup.bind('.ui-popup-common-alert').open();
|
||||
},
|
||||
function(code, rstData) {
|
||||
research.logger.error('Do nothing. code: '+ code, rstData);
|
||||
krs.logger.error('Do nothing. code: '+ code, rstData);
|
||||
},
|
||||
'html');
|
||||
},
|
||||
@@ -133,17 +133,16 @@ var ajaxUtil = {
|
||||
if (typeof errorCallback !== 'undefined') {
|
||||
errorCallback(ajaxUtil.$404, rstData);
|
||||
} else {
|
||||
ajaxUtil._goToMain();
|
||||
krs.move.main();
|
||||
}
|
||||
},
|
||||
401:function(){
|
||||
ajaxUtil._goToMain();
|
||||
krs.move.main();
|
||||
},
|
||||
403:function(rstData){
|
||||
ajaxUtil._goToMain();
|
||||
krs.move.main();
|
||||
},
|
||||
422:function(rstData, status) {
|
||||
alert(422)
|
||||
console.log(rstData)
|
||||
$(rstData.responseJSON).each((idx, oj) => {
|
||||
// TODO : form id? or body
|
||||
@@ -203,7 +202,6 @@ var ajaxUtil = {
|
||||
_jsonParse : function parse(jsonStr) {
|
||||
try {
|
||||
var jsonObj = JSON.parse(jsonStr);
|
||||
// chamobile.logger.debug(jsonObj);
|
||||
return jsonObj;
|
||||
} catch (error) {
|
||||
console.error("Invalid JSON string:", error);
|
||||
@@ -213,7 +211,6 @@ var ajaxUtil = {
|
||||
_jsonStringify : function stringify(obj) {
|
||||
try {
|
||||
var jsonStr = JSON.stringify(obj);
|
||||
// chamobile.logger.debug(jsonStr);
|
||||
return jsonStr;
|
||||
} catch (error) {
|
||||
console.error("Error stringifying object:", error);
|
||||
|
||||
@@ -1,32 +1,39 @@
|
||||
let krs = {}; // KoreaReSearch
|
||||
krs.move = new Object;
|
||||
krs.logger = new Object();
|
||||
|
||||
/* krs.move */
|
||||
/**
|
||||
* 스크립트로 페이지 이동
|
||||
*/
|
||||
krs.move.main = function() {
|
||||
location.href = '/';
|
||||
}
|
||||
|
||||
|
||||
var research = {};
|
||||
research.json = new Object();
|
||||
research.logger = new Object();
|
||||
|
||||
/* research.logger */
|
||||
/* krs.logger */
|
||||
/**
|
||||
* client 오류성 로그 기록용 로거, 로그 레벨에 따라 표시
|
||||
* @param message
|
||||
* @param el
|
||||
*/
|
||||
research.logger.debug = function(message, el){
|
||||
var callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
krs.logger.debug = function(message, el){
|
||||
let callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
console.log("[DEBUG] caller : " + callee + " / message : " + message, el);
|
||||
};
|
||||
|
||||
research.logger.error = function(message, el){
|
||||
var callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
krs.logger.error = function(message, el){
|
||||
let callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
console.error("[ERROR] caller : " + callee + " / message : " + message, el);
|
||||
};
|
||||
|
||||
research.logger.info = function(message){
|
||||
var callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
krs.logger.info = function(message){
|
||||
let callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
console.info("[INFO] caller : " + callee + " / message : " + message);
|
||||
};
|
||||
|
||||
research.logger.warn = function(message){
|
||||
var callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
krs.logger.warn = function(message){
|
||||
let callee = arguments.callee.caller == '' ? arguments.callee.caller.arguments.callee.name : (arguments.callee.caller ? arguments.callee.caller.name : '');
|
||||
console.warn("[WARN] caller : " + callee + " / message : " + message);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,30 +1,36 @@
|
||||
var page = {};
|
||||
page.daily = new Object();
|
||||
let krsp= {}; // KoreaReSearchPage
|
||||
krsp.daily = new Object();
|
||||
|
||||
page.daily.httpUrl = {
|
||||
root: '/record/calendar',
|
||||
daily: '/record/daily/{searchMonth}/{groupNo}',
|
||||
income: '/record/income/{searchMonth}/{groupNo}',
|
||||
work: '/record/work/{searchMonth}/{groupNo}',
|
||||
expense: '/record/expense/{searchMonth}/{groupNo}',
|
||||
power: '/record/power/{searchMonth}/{groupNo}',
|
||||
forestry: '/record/forestry/{searchMonth}/{groupNo}',
|
||||
krsp.daily.httpUrl = {
|
||||
base: '/record/calendar',
|
||||
daily: '/record/daily/{month}/{groupNo}',
|
||||
target: '/record/daily/{month}/{groupNo}/{target}',
|
||||
// income: '/record/daily/{month}/{groupNo}/income',
|
||||
// work: '/record/daily/{month}/{groupNo}/work',
|
||||
// expense: '/record/daily/{month}/{groupNo}/expense',
|
||||
// power: '/record/daily/{month}/{groupNo}/power',
|
||||
// forestry: '/record/daily/{month}/{groupNo}/forestry',
|
||||
};
|
||||
|
||||
krsp.daily.goToMain = function() {
|
||||
location.href = krsp.daily.httpUrl.root;
|
||||
};
|
||||
|
||||
krsp.daily.goToPrev = function(target, searchMonth, groupNo) {
|
||||
let url = krsp.daily.httpUrl.target;
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target);
|
||||
|
||||
console.log(url);
|
||||
}
|
||||
|
||||
page.daily.goToMain = function() {
|
||||
location.href = page.daily.httpUrl.root;
|
||||
}
|
||||
krsp.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
let url = krsp.daily.httpUrl.target;
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target);
|
||||
|
||||
page.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
let url = page.daily.httpUrl.root;
|
||||
|
||||
// TODO URL
|
||||
if (target == 'income') {
|
||||
url = page.daily.httpUrl.income;
|
||||
} else if (target == 'work') {
|
||||
url = page.daily.httpUrl.work;
|
||||
}
|
||||
|
||||
console.log(url.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo));
|
||||
//location.href = url.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo);
|
||||
}
|
||||
console.log(url);
|
||||
//location.href = url;
|
||||
};
|
||||
@@ -84,6 +84,10 @@
|
||||
<strong>Current Device</strong> : [[${currentDevice}]]
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Current URI</strong> : [[${currentURI.id}]]
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<strong>Current Login User</strong> :
|
||||
<p sec:authorize="isAnonymous()" th:remove="tag">
|
||||
@@ -91,6 +95,7 @@
|
||||
</p>
|
||||
<p sec:authorize="isAuthenticated()" th:remove="tag">
|
||||
<strong th:text="${#authentication.principal.ownerName}">로그인 사용자명</strong>
|
||||
, seq=<strong th:text="${#authentication.principal.householdSeq}">로그인 사용자SEQ</strong>
|
||||
<a href="/logout">[로그아웃]</a>
|
||||
<a href="/user/info">[정보수정]</a>
|
||||
</p>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
$('#selectedDay').html(rstHtml);
|
||||
},
|
||||
function(code, rstData) {
|
||||
research.logger.error('Do nothing. code: '+ code, rstData);
|
||||
krs.logger.error('Do nothing. code: '+ code, rstData);
|
||||
},
|
||||
'html'
|
||||
);
|
||||
|
||||
@@ -48,6 +48,40 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<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>
|
||||
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
@@ -79,9 +113,9 @@
|
||||
console.log(rstData);
|
||||
|
||||
if (f.todayNone.value == 'Y') {
|
||||
page.daily.goToMain();
|
||||
krsp.daily.goToMain();
|
||||
} else {
|
||||
page.daily.goToNext($('input:checked').eq(0).data('target'), searchMonth, groupNo);
|
||||
krsp.daily.goToNext($('input:checked').eq(0).data('target'), searchMonth, groupNo);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user