Merge branch 'dev' into 'deploy-dev-front'
Dev See merge request korea-research/korea-research!39
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package app.module.admin.config.application.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
@@ -10,4 +12,10 @@ public enum ManagementType {
|
||||
CALL("전화상담"),
|
||||
ETC("기타");
|
||||
private final String desc;
|
||||
|
||||
@JsonCreator
|
||||
public static ManagementType from(String value) {
|
||||
if (!StringUtils.hasText(value)) return null;
|
||||
return ManagementType.valueOf(value.toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.annotation.DeleteCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.RemoveHouseholdVisitInfosPortOut;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class RemoveHouseholdVisitInfosDao implements RemoveHouseholdVisitInfosPortOut {
|
||||
private final RemoveHouseholdVisitInfosMapper mapper;
|
||||
|
||||
@Override
|
||||
@DeleteCommand
|
||||
public void operate(RemoveHouseholdVisitInfosCmd cmd) {
|
||||
mapper.removeHouseholdVisitInfos(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveHouseholdVisitInfosMapper {
|
||||
void removeHouseholdVisitInfos(RemoveHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.RemoveHouseholdVisitInfosPortIn;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.web.model.RemoveHouseholdVisitInfosReqVO;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.web.model.RemoveHouseholdVisitInfosResVO;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class RemoveHouseholdVisitInfosController {
|
||||
|
||||
private final MessageUtil messageUtil;
|
||||
private final RemoveHouseholdVisitInfosPortIn portIn;
|
||||
|
||||
@DeleteMapping(path = "/api/visitInfo/remove")
|
||||
ResponseEntity<?> operate(
|
||||
@Valid @RequestBody RemoveHouseholdVisitInfosReqVO reqVO,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult);
|
||||
}
|
||||
|
||||
portIn.operate(
|
||||
new RemoveHouseholdVisitInfosCmd(reqVO.getHouseholdSeq(), reqVO.getRemoveIds()));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new RemoveHouseholdVisitInfosResVO(
|
||||
messageUtil.getMessage("operation.common.remove.done")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.web.model;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class RemoveHouseholdVisitInfosReqVO {
|
||||
private Long householdSeq;
|
||||
private List<Long> removeIds;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class RemoveHouseholdVisitInfosResVO {
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
|
||||
public interface RemoveHouseholdVisitInfosPortIn {
|
||||
void operate(RemoveHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
|
||||
public interface RemoveHouseholdVisitInfosPortOut {
|
||||
void operate(RemoveHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain.RemoveHouseholdVisitInfosCmd;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.RemoveHouseholdVisitInfosPortIn;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.RemoveHouseholdVisitInfosPortOut;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class RemoveHouseholdVisitInfosService implements RemoveHouseholdVisitInfosPortIn {
|
||||
private final RemoveHouseholdVisitInfosPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(RemoveHouseholdVisitInfosCmd cmd) {
|
||||
portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class RemoveHouseholdVisitInfosCmd extends AuditCommand {
|
||||
private Long householdSeq;
|
||||
private List<Long> removeIds;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.AuditUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.SaveHouseholdVisitInfoPortOut;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class SaveHouseholdVisitInfoDao implements SaveHouseholdVisitInfoPortOut {
|
||||
private final SaveHouseholdVisitInfoMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void operate(SaveHouseholdVisitInfoCmd cmd) {
|
||||
if (cmd.getVisitInfoId() != null) {
|
||||
mapper.findById(cmd.getHouseholdSeq())
|
||||
.ifPresentOrElse(
|
||||
v -> mapper.updateHouseholdVisitInfo(AuditUtil.update(cmd)),
|
||||
() -> { throw new IllegalArgumentException("방문정보가 없습니다."); }
|
||||
);
|
||||
} else {
|
||||
mapper.createHouseholdVisitInfo(AuditUtil.create(cmd));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SaveHouseholdVisitInfoMapper {
|
||||
Optional<Long> findById(Long id);
|
||||
void createHouseholdVisitInfo(SaveHouseholdVisitInfoCmd cmd);
|
||||
void updateHouseholdVisitInfo(SaveHouseholdVisitInfoCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.SaveHouseholdVisitInfoPortIn;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.model.SaveHouseholdVisitInfoReqVO;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.model.SaveHouseholdVisitInfoResVO;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.validator.SaveHouseholdVisitInfoValidator;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class SaveHouseholdVisitInfoController {
|
||||
private final SaveHouseholdVisitInfoValidator validator;
|
||||
private final SaveHouseholdVisitInfoPortIn portIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@PostMapping(path = "/api/visitInfo/save")
|
||||
ResponseEntity<?> operate(
|
||||
@Valid @RequestBody SaveHouseholdVisitInfoReqVO reqVO,
|
||||
BindingResult bindingResult) {
|
||||
validator.validate(reqVO, bindingResult);
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
||||
}
|
||||
|
||||
portIn.operate(new SaveHouseholdVisitInfoCmd(
|
||||
reqVO.getVisitInfoId(),
|
||||
reqVO.getHouseholdSeq(),
|
||||
reqVO.getVisitDate(),
|
||||
reqVO.getManagementType().name(),
|
||||
reqVO.getContent(),
|
||||
reqVO.getIsGiftSent()));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(
|
||||
new SaveHouseholdVisitInfoResVO(messageUtil.getMessage("operation.common.save.done")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.model;
|
||||
|
||||
import app.module.admin.config.application.enums.ManagementType;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import groovy.transform.NamedParam;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class SaveHouseholdVisitInfoReqVO {
|
||||
private Long visitInfoId;
|
||||
private Long householdSeq;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date visitDate;
|
||||
private ManagementType managementType;
|
||||
private String content;
|
||||
private Boolean isGiftSent;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class SaveHouseholdVisitInfoResVO {
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.validator;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.web.model.SaveHouseholdVisitInfoReqVO;
|
||||
import java.util.Date;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.Validator;
|
||||
|
||||
@Component
|
||||
public class SaveHouseholdVisitInfoValidator implements Validator {
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return SaveHouseholdVisitInfoReqVO.class.equals(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
SaveHouseholdVisitInfoReqVO vo = (SaveHouseholdVisitInfoReqVO) target;
|
||||
|
||||
if (vo.getHouseholdSeq() == null) {
|
||||
errors.reject("householdSeq", "임가 정보가 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vo.getVisitDate() == null) {
|
||||
errors.reject("visitDate", "방문일자를 입력해 주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vo.getVisitDate().after(new Date())) {
|
||||
errors.reject("visitDate", "미래 날짜는 입력할 수 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vo.getManagementType() == null) {
|
||||
errors.reject("managementType", "방문조사 유형을 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (!StringUtils.hasText(vo.getContent())) {
|
||||
errors.reject("content", "내용을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
|
||||
public interface SaveHouseholdVisitInfoPortIn {
|
||||
void operate(SaveHouseholdVisitInfoCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
|
||||
public interface SaveHouseholdVisitInfoPortOut {
|
||||
void operate(SaveHouseholdVisitInfoCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain.SaveHouseholdVisitInfoCmd;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.SaveHouseholdVisitInfoPortIn;
|
||||
import app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.SaveHouseholdVisitInfoPortOut;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class SaveHouseholdVisitInfoService implements SaveHouseholdVisitInfoPortIn {
|
||||
private final SaveHouseholdVisitInfoPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(SaveHouseholdVisitInfoCmd cmd) {
|
||||
portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class SaveHouseholdVisitInfoCmd extends AuditCommand {
|
||||
private Long visitInfoId;
|
||||
private Long householdSeq;
|
||||
private Date visitDate;
|
||||
private String managementType;
|
||||
private String content;
|
||||
private Boolean isGiftSent;
|
||||
}
|
||||
@@ -54,6 +54,11 @@ public class ResearcherDao implements ResearcherPortOut {
|
||||
return new PageImpl<>(result, pageable, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO) {
|
||||
return researcherMapper.selectVisitHouseholdPercentage(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO) {
|
||||
List<ResearchersHouseholdVisitDto> result = researcherMapper.visitHouseholdList(reqVO);
|
||||
|
||||
@@ -22,6 +22,7 @@ public interface ResearcherMapper {
|
||||
ResearchersHouseholdVisitDto visitHouseholdDetail(Integer id);
|
||||
Long visitHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
||||
Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO);
|
||||
VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO);
|
||||
Integer visitHouseholdDelete(@Param("selectIds") List<Integer> selectIds,@Param("deletedBy") String deletedBy);
|
||||
void deleteHouseholdResearcherMapping(@Param("researcherSeq") Integer researcherSeq, @Param("householdSeq") Integer householdSeq, @Param("deletedBy") String deletedBy);
|
||||
Integer insertHouseholdResearcherMapping(@Param("researcherSeq") Integer researcherSeq, @Param("householdSeq") Integer householdSeq, @Param("createdBy") String createdBy);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.researcher.adpaters.persistence.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VisitHouseholdPercentageDto {
|
||||
private Integer totalHouseholdCount;
|
||||
private Integer firstVisitCount;
|
||||
private Integer secondVisitCount;
|
||||
private Integer giftSentCount;
|
||||
private Double firstVisitPercentage;
|
||||
private Double secondVisitPercentage;
|
||||
private Double giftSentPercentage;
|
||||
}
|
||||
@@ -29,6 +29,11 @@ class ResearcherApiController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(researcherPortIn.mappingHouseholdList(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping(path = "/visitHousehold/percentage")
|
||||
ResponseEntity<?> selectVisitHouseholdPercentage( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(researcherPortIn.selectVisitHouseholdPercentage(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping(path = "/visitHousehold/list")
|
||||
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(researcherPortIn.visitHouseholdList(reqVO));
|
||||
|
||||
@@ -11,6 +11,7 @@ public interface ResearcherPortIn {
|
||||
ResearchersDto detail(Integer adminSeq);
|
||||
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
|
||||
Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
||||
VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO);
|
||||
Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO);
|
||||
ResearchersHouseholdVisitPopUpDto visitHouseholdDetail(Integer id);
|
||||
Integer visitHouseholdDelete(List<Integer> selectIds);
|
||||
|
||||
@@ -10,6 +10,7 @@ public interface ResearcherPortOut {
|
||||
Page<ResearchersDto> list(ResearchersListReqVO reqVO);
|
||||
ResearchersDto detail(Integer adminSeq);
|
||||
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
|
||||
VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO);
|
||||
Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
||||
Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO);
|
||||
ResearchersHouseholdVisitPopUpDto visitHouseholdDetail(Integer id);
|
||||
|
||||
@@ -35,6 +35,11 @@ class ResearcherService implements ResearcherPortIn {
|
||||
return portOut.visitHouseholdList(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO) {
|
||||
return portOut.selectVisitHouseholdPercentage(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO) {
|
||||
return portOut.updateVisitHousehold(reqVO);
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
AND bat.is_deleted = false
|
||||
ORDER BY bat.created_at
|
||||
</select>
|
||||
|
||||
<select id="getBankAutoTransferExpenseRecords"
|
||||
@@ -78,5 +79,6 @@
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
AND bat.is_deleted = false
|
||||
ORDER BY bat.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -48,6 +48,7 @@
|
||||
AND ui_unit.id = di.unit_code
|
||||
WHERE di.daily_record_seq = #{recordSeq}
|
||||
AND di.is_deleted = false
|
||||
ORDER BY di.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyWorkRecords"
|
||||
@@ -89,6 +90,7 @@
|
||||
AND ui_harvest.id = dw.harvest_unit_code
|
||||
WHERE dw.daily_record_seq = #{recordSeq}
|
||||
AND dw.is_deleted = false
|
||||
ORDER BY dw.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyExpenseRecords"
|
||||
@@ -116,6 +118,7 @@
|
||||
AND ui_unit.id = de.unit_code
|
||||
WHERE de.daily_record_seq = #{recordSeq}
|
||||
AND de.is_deleted = false
|
||||
ORDER BY de.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyPowerRecords"
|
||||
@@ -130,6 +133,7 @@
|
||||
FROM daily_power dp
|
||||
WHERE dp.daily_record_seq = #{recordSeq}
|
||||
AND dp.is_deleted = false
|
||||
ORDER BY dp.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyForestryRecords"
|
||||
@@ -154,6 +158,7 @@
|
||||
AND ui_unit.id = df.unit_code
|
||||
WHERE df.daily_record_seq = #{recordSeq}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyFarmingRecords"
|
||||
@@ -184,6 +189,7 @@
|
||||
AND ui_unit.id = df.unit_code
|
||||
WHERE df.daily_record_seq = #{recordSeq}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -68,5 +68,6 @@
|
||||
WHERE df.household_seq = #{householdSeq}
|
||||
AND df.month = #{recordMonth}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -16,5 +16,7 @@
|
||||
FROM household_visit hv
|
||||
WHERE household_seq = #{householdSeq}
|
||||
AND TO_CHAR(visit_date, 'YYYYMM') = #{recordMonth}
|
||||
AND hv.is_deleted = false
|
||||
ORDER BY hv.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.persistence.RemoveHouseholdVisitInfosMapper">
|
||||
<update id="removeHouseholdVisitInfos">
|
||||
/* removeHouseholdVisitInfos : 임가방문정보 삭제 */
|
||||
UPDATE household_visit
|
||||
SET <include refid="common.fields.DeleteBaseSet"/>
|
||||
WHERE id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.persistence.SaveHouseholdVisitInfoMapper">
|
||||
<insert id="createHouseholdVisitInfo">
|
||||
/* createHouseholdVisitInfo : 임가방문정보 등록 */
|
||||
INSERT INTO household_visit
|
||||
(
|
||||
household_seq,
|
||||
visit_date,
|
||||
management_type,
|
||||
is_gift_sent,
|
||||
content,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{householdSeq},
|
||||
#{visitDate},
|
||||
#{managementType},
|
||||
#{isGiftSent},
|
||||
#{content},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateHouseholdVisitInfo">
|
||||
/* updateHouseholdVisitInfo : 임가방문정보 수정 */
|
||||
UPDATE household_visit
|
||||
SET
|
||||
visit_date = #{visitDate},
|
||||
management_type = #{managementType},
|
||||
is_gift_sent = #{isGiftSent},
|
||||
content = #{content},
|
||||
<include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE id = #{visitInfoId}
|
||||
</update>
|
||||
|
||||
<select id="findById" resultType="java.lang.Long">
|
||||
/* findById : 임가방문정보 조회 */
|
||||
SELECT id
|
||||
FROM household_visit
|
||||
WHERE id = #{id}
|
||||
AND is_deleted = false
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -121,9 +121,8 @@
|
||||
case rhv.is_gift_sent when false then '전달완료' when true then '-' end is_gift_sent_flag,
|
||||
rhv.created_at
|
||||
from household_visit rhv
|
||||
join researcher_has_household rhh on rhh.household_seq = rhv.household_seq
|
||||
join household h on rhh.household_seq = h.seq
|
||||
join admin a on a.seq = rhh.admin_seq
|
||||
join household h on rhv.household_seq = h.seq
|
||||
join researcher_has_household rhh on rhh.household_seq = h.seq and rhh.is_deleted = false
|
||||
where rhv.is_deleted = false
|
||||
<if test="seq > 0">
|
||||
and rhh.admin_seq = #{seq}
|
||||
@@ -134,6 +133,66 @@
|
||||
LIMIT #{size} OFFSET #{page}*#{size}
|
||||
</select>
|
||||
|
||||
<select id="selectVisitHouseholdPercentage">
|
||||
with visit_ranking AS (
|
||||
select
|
||||
hv.household_seq,
|
||||
hv.visit_date,
|
||||
hv.is_gift_sent,
|
||||
ROW_NUMBER() OVER (PARTITION BY hv.household_seq ORDER BY hv.visit_date ASC) AS visit_rank
|
||||
from household_visit hv
|
||||
where TO_CHAR(hv.visit_date, 'YYYYMM') = #{searchMonth}
|
||||
and hv.is_deleted = FALSE
|
||||
),
|
||||
visit_counts AS (
|
||||
select
|
||||
COUNT(DISTINCT CASE WHEN vr.visit_rank = 1 THEN vr.household_seq END) AS first_visit_count,
|
||||
COUNT(DISTINCT CASE WHEN vr.visit_rank = 2 THEN vr.household_seq END) AS second_visit_count,
|
||||
COUNT(DISTINCT CASE WHEN vr.is_gift_sent = true THEN vr.household_seq END) AS gift_sent_count
|
||||
from researcher_has_household rhh
|
||||
left join visit_ranking vr ON rhh.household_seq = vr.household_seq
|
||||
where rhh.is_deleted = false
|
||||
and rhh.admin_seq = #{seq}
|
||||
),
|
||||
total_households AS (
|
||||
select COUNT(DISTINCT rhh.household_seq) AS total_household_count
|
||||
from researcher_has_household rhh
|
||||
where rhh.is_deleted = false
|
||||
AND rhh.admin_seq = #{seq}
|
||||
)
|
||||
SELECT
|
||||
th.total_household_count ,
|
||||
vc.first_visit_count,
|
||||
vc.second_visit_count,
|
||||
vc.gift_sent_count,
|
||||
ROUND(
|
||||
CASE
|
||||
WHEN th.total_household_count > 0
|
||||
THEN (vc.first_visit_count::NUMERIC / th.total_household_count) * 100
|
||||
ELSE 0
|
||||
END,
|
||||
2
|
||||
) AS first_visit_percentage,
|
||||
ROUND(
|
||||
CASE
|
||||
WHEN th.total_household_count > 0
|
||||
THEN (vc.second_visit_count::NUMERIC / th.total_household_count) * 100
|
||||
ELSE 0
|
||||
END,
|
||||
2
|
||||
) AS second_visit_percentage,
|
||||
ROUND(
|
||||
CASE
|
||||
WHEN th.total_household_count > 0
|
||||
THEN (vc.gift_sent_count::NUMERIC / th.total_household_count) * 100
|
||||
ELSE 0
|
||||
END,
|
||||
2
|
||||
) AS gift_sent_percentage
|
||||
FROM total_households th
|
||||
CROSS JOIN visit_counts vc
|
||||
</select>
|
||||
|
||||
<select id="visitHouseholdListCountAll">
|
||||
select count(*)
|
||||
from household_visit rhv
|
||||
|
||||
@@ -211,7 +211,9 @@ uiUtil.uploadFile = (fileUploadType, input) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const inputGroup = $(input).parent('.input-group');
|
||||
|
||||
const inputGroup = $(input).parent().parent().find('.input-group');
|
||||
|
||||
if (!inputGroup.length) {
|
||||
alert(
|
||||
`${input.name} 앨리먼트의 부모가 input-group 클래스를 가져야 uiUtil.uploadFile 메서드를 실행할 수 있습니다.`);
|
||||
@@ -246,11 +248,11 @@ uiUtil.uploadFile = (fileUploadType, input) => {
|
||||
inputGroup.find('.invalid-feedback').text('');
|
||||
|
||||
// 기존 mappingId 가 있다면 초기화
|
||||
inputGroup.find('input[name=fileMappingId]').remove();
|
||||
/* inputGroup.find('input[name=fileMappingId]').remove();*/
|
||||
|
||||
// 신규 mappingId 추가
|
||||
/* // 신규 mappingId 추가
|
||||
inputGroup.append(
|
||||
`<input type="hidden" name="fileMappingId" value="${res.id}"/>`);
|
||||
`<input type="hidden" name="fileMappingId" value="${res.id}"/>`);*/
|
||||
|
||||
// 업로드 파일 정보 보이기
|
||||
uiUtil.showFileInfo(input, res, $(input).attr('accept') === 'image/*');
|
||||
@@ -274,18 +276,16 @@ uiUtil.uploadFile = (fileUploadType, input) => {
|
||||
* @param {boolean} showImg 미리보기 이미지 노출 여부
|
||||
*/
|
||||
uiUtil.showFileInfo = (input, uploadFile, showImg) => {
|
||||
const inputGroup = $(input).parent('.input-group');
|
||||
const inputGroup = $(input).parent().parent().find('.input-group');
|
||||
if (!inputGroup.length) {
|
||||
alert(
|
||||
`${input.name} 앨리먼트의 부모가 input-group 클래스를 가져야 showFileInfo 메서드를 실행할 수 있습니다.`);
|
||||
return;
|
||||
}
|
||||
|
||||
inputGroup.find('.fileInfo').remove();
|
||||
/* inputGroup.find('.fileInfo').remove();*/
|
||||
|
||||
|
||||
|
||||
inputGroup.append(`
|
||||
/* inputGroup.append(`
|
||||
<div class="fileInfo row text-muted fw-normal" style="display: none">
|
||||
<img src="${showImg ? uploadFile.referURL : ''}" class="w-75 mt-3 mb-3"/>
|
||||
<ul class="row" style="margin-left: 10px;">
|
||||
@@ -295,31 +295,28 @@ uiUtil.showFileInfo = (input, uploadFile, showImg) => {
|
||||
<li class="id">File ID (${uploadFile.id})<span class="btn-sm btn-link fw-bold resetFile" style="cursor:pointer;">삭제</span> </li>
|
||||
</ul>
|
||||
</div>
|
||||
`);
|
||||
`);*/
|
||||
|
||||
inputGroup.append(`
|
||||
<li class="fileInfo" style="display: none;">
|
||||
<p><a href="${uploadFile.attachmentURL}">${uploadFile.originName}(${Math.ceil(uploadFile.fileLength / 1024)}KB)</a></p>
|
||||
<button type="button" class="btn-delete resetFile"><span class="hide-txt ">삭제</span></button>
|
||||
<input type="hidden" name="fileMappingId" value="${uploadFile.id}" />
|
||||
</li>`);
|
||||
|
||||
|
||||
|
||||
const fileInfo = inputGroup.find('.fileInfo');
|
||||
if (!showImg) {
|
||||
/* if (!showImg) {
|
||||
fileInfo.find('img').remove();
|
||||
}
|
||||
}*/
|
||||
|
||||
// 파일 삭제 함수 정의
|
||||
inputGroup.find('.resetFile').on('click', () => {
|
||||
let fileInput = inputGroup.find('input[type=file]');
|
||||
fileInput.replaceWith(`
|
||||
<input type="file"
|
||||
id="${fileInput.attr('id')}"
|
||||
class="${fileInput.attr('class')}"
|
||||
accept="${fileInput.attr('accept')}"
|
||||
name="${fileInput.attr('name')}"
|
||||
onchange="${fileInput.attr('onchange')}">
|
||||
`);
|
||||
|
||||
inputGroup.find('input[name=fileMappingId]').remove();
|
||||
inputGroup.find('.fileInfo').fadeOut((evt) => {
|
||||
$(evt.target).remove();
|
||||
inputGroup.find('.resetFile').on('click', function () {
|
||||
const $fileInfo = $(this).closest('.fileInfo');
|
||||
$fileInfo.fadeOut(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<tr>
|
||||
<th>제목<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
|
||||
<td colspan="3">
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" name="title" id="title" placeholder="">
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" name="title" id="title" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -28,20 +28,28 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>첨부파일<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
|
||||
<th>첨부파일</th>
|
||||
<td colspan="3">
|
||||
<div class="input-file-group">
|
||||
<label for="file" class="input-file-btn">
|
||||
<input type="file" name="multipartAttachments" id="file" onchange="uiUtil.uploadFile('NOTICE', this);" >
|
||||
<span class="file-txt">파일첨부</span>
|
||||
</label>
|
||||
<p class="desc">첨부 가능 파일 형식: 문서(pdf, docx, xlsx, pptx, hwp), 이미지(jpg, jpeg, png, gif), 기타(zip,
|
||||
csv, txt) / 파일당 최대 5MB까지 등록 가능합니다.</p>
|
||||
<ul class="file-list input-group" id="noticeAttachments">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<!-- <td colspan="3">
|
||||
<div class="btns-row align-left publicFileInputs">
|
||||
<button type="button" class="btn btn-secondary" onclick="addFileInput();">
|
||||
<span class="btn-txt">다건 파일 첨부</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</td>-->
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>게시기간<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
|
||||
<td colspan="2">
|
||||
@@ -57,11 +65,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>노출여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
|
||||
<td>
|
||||
@@ -75,8 +81,6 @@
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -102,7 +106,6 @@
|
||||
|
||||
<script th:inline="javascript">
|
||||
|
||||
|
||||
$(".flatpickr").flatpickr({
|
||||
dateFormat: "Y-m-d\\TH:i",
|
||||
// altInput: true,
|
||||
@@ -111,6 +114,7 @@
|
||||
enableTime: true,
|
||||
time_24hr: true
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
@@ -120,13 +124,11 @@
|
||||
history.back();
|
||||
}
|
||||
|
||||
|
||||
const gotoList = () => {
|
||||
location.href = '/communication/notices';
|
||||
}
|
||||
|
||||
|
||||
function addFileInput() {
|
||||
/* function addFileInput() {
|
||||
const inputGroup = $(`
|
||||
<div class="input-group w-50">
|
||||
<input class="form-control mb-2" type="file" name="multipartAttachments"
|
||||
@@ -142,7 +144,7 @@
|
||||
return inputGroup;
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
const getNotice = () => {
|
||||
const f = document.reqForm;
|
||||
@@ -167,11 +169,10 @@
|
||||
f.visible.value = res.visible;
|
||||
|
||||
res.uploadFiles.forEach((uploadFile) => {
|
||||
|
||||
let inputGroup = addFileInput();
|
||||
inputGroup.append(`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFileInfo(inputGroup.find('input[type=file]'), uploadFile, false);
|
||||
|
||||
let inputGroup = $('#noticeAttachments');
|
||||
/* let inputGroup = addFileInput();
|
||||
inputGroup.append(`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);*/
|
||||
uiUtil.showFileInfo(inputGroup, uploadFile, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -180,9 +181,6 @@
|
||||
// 상세정보 얻기
|
||||
getNotice();
|
||||
|
||||
|
||||
|
||||
|
||||
const goSave = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
|
||||
@@ -380,7 +380,8 @@
|
||||
|
||||
// 현재 로그인한 유저의 역할
|
||||
const isResearcher = f.userRole.value === 'ROLE_RESEARCHER';
|
||||
const colspanLength = isResearcher ? 13 : 15;
|
||||
// const colspanLength = isResearcher ? 13 : 15; <!-- TODO : 2차 오픈 -->
|
||||
const colspanLength = isResearcher ? 10 : 12;
|
||||
|
||||
// 조사원일 경우 조사원이름, 번호 칼럼 hide
|
||||
$('.hide-role-researcher').toggle(!isResearcher);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<table class="type-form">
|
||||
<table class="type-form confirm">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
@@ -125,6 +125,7 @@
|
||||
// 임가방문정보 모달창 띄우기
|
||||
const showVisitInfoModal = (id) => {
|
||||
const f = document.reqVisitForm;
|
||||
f.householdSeq.value = householdSeq;
|
||||
|
||||
resetForm();
|
||||
|
||||
@@ -177,21 +178,22 @@
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
// ajaxUtil._ajaxMethod(
|
||||
// '/api/visitInfo/create',
|
||||
// JSON.stringify(dataOj),
|
||||
// (response) => { // 성공
|
||||
// alert("등록이 완료되었습니다.");
|
||||
// location.href = '/households';
|
||||
// },
|
||||
// function (code, rstData) {
|
||||
// if(code == 422) alert(rstData.responseText);
|
||||
// if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
// },
|
||||
// 'post',
|
||||
// 'json',
|
||||
// { handle422Type: 'alert' }
|
||||
// );
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/save',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("등록이 완료되었습니다.");
|
||||
document.querySelector(".modal-visit-info").ui.close();
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
},
|
||||
'post',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -215,11 +217,6 @@
|
||||
datepickerInstance.setDate(new Date(), { render: true });
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
const reqForm = document.reqForm;
|
||||
document.reqVisitForm.householdSeq.value = reqForm.householdSeq.value;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -10,7 +10,7 @@
|
||||
<h3></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" onclick="goDeleteVisitInfo();">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary" onclick="showVisitInfoModal();">
|
||||
@@ -68,7 +68,7 @@
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
<input type="checkbox" id="removeIds_${item.id}" name="removeIds" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
@@ -93,6 +93,37 @@
|
||||
'json'
|
||||
);
|
||||
}
|
||||
|
||||
// 임가방문정보 삭제
|
||||
const goDeleteVisitInfo = () => {
|
||||
const infoIds = $('input[name=removeIds]:checked');
|
||||
if(infoIds.length <= 0) {
|
||||
alert("임가방문정보를 선택해주세요.");
|
||||
return
|
||||
}
|
||||
|
||||
if(confirm("선택하신 내용을 삭제하시겠습니까? 삭제한 항목은 복구할 수 없습니다.")) {
|
||||
const f = document.reqForm;
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/remove',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("방문정보가 삭제되었습니다.");
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
},
|
||||
'delete',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -178,6 +178,10 @@
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
const householdSeq = document.reqForm.householdSeq.value;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 일계부 완료상태
|
||||
const statusInfoMap = {
|
||||
|
||||
@@ -97,6 +97,22 @@
|
||||
</div>
|
||||
<div class="tab-content" data-tab-value="tab2" th:unless="${activeProfile != 'local'}">
|
||||
<div class="content-inner">
|
||||
<article class="summary-area">
|
||||
<ul>
|
||||
<li>
|
||||
<p>당월 1차 방문</p>
|
||||
<span><strong id="firstVisitCount">6</strong>/<strong class="totalHouseholdCount">6</strong>(<strong id="firstVisitPercentage">6</strong>%)</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>당월 2차 방문</p>
|
||||
<span><strong id="secondVisitCount">6</strong>/<strong class="totalHouseholdCount">6</strong>(<strong id="secondVisitPercentage">6</strong>%)</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>답례품 전달</p>
|
||||
<span><strong id="giftSentCount">6</strong>/<strong class="totalHouseholdCount">6</strong>(<strong id="giftSentPercentage">6</strong>%)</span>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3>총 <strong id="household-visit-totalElements"></strong>건</h3>
|
||||
@@ -108,24 +124,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input onchange="toggleCheckbox(this);" type="checkbox"/>
|
||||
</th>
|
||||
<th>임가번호</th>
|
||||
<th>경영주명</th>
|
||||
<th>방문일</th>
|
||||
<th>관리분야</th>
|
||||
<th>내용</th>
|
||||
<th>작성일</th>
|
||||
<th>답례품 전달</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="household-visit-list">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input onchange="toggleCheckbox(this);" type="checkbox"/>
|
||||
</th>
|
||||
<th>임가번호</th>
|
||||
<th>경영주명</th>
|
||||
<th>방문일</th>
|
||||
<th>관리분야</th>
|
||||
<th>내용</th>
|
||||
<th>작성일</th>
|
||||
<th>답례품 전달</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="household-visit-list">
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,6 +186,7 @@
|
||||
if (!form.searchMonth.value) {
|
||||
form.searchMonth.value = '[[${currentMonth}]]'; // 기본값 복원
|
||||
}
|
||||
getVisitHouseholdPercentage();
|
||||
getHouseholdVisitList(0);
|
||||
}
|
||||
});
|
||||
@@ -241,6 +259,35 @@
|
||||
);
|
||||
}
|
||||
|
||||
// 임가 방문 퍼센트
|
||||
const getVisitHouseholdPercentage=()=>{
|
||||
const f = document.householdReqForm;
|
||||
|
||||
let dataObj = {
|
||||
seq: f.seq.value,
|
||||
searchMonth: f.searchMonth.value,
|
||||
};
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/researcher/visitHousehold/percentage',
|
||||
dataObj,
|
||||
function (response) {
|
||||
$('#firstVisitCount').text(response.firstVisitCount);
|
||||
$('#secondVisitCount').text(response.secondVisitCount);
|
||||
$('#giftSentCount').text(response.giftSentCount);
|
||||
$('#firstVisitPercentage').text(response.firstVisitPercentage);
|
||||
$('#secondVisitPercentage').text(response.secondVisitPercentage);
|
||||
$('#giftSentPercentage').text(response.giftSentPercentage);
|
||||
$('.totalHouseholdCount').text(response.totalHouseholdCount);
|
||||
},
|
||||
function (code, rstData) {
|
||||
|
||||
},
|
||||
'get',
|
||||
'json',
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
// 임가 방문 정보
|
||||
const getHouseholdVisitList = (pageNo) => {
|
||||
const f = document.householdReqForm;
|
||||
@@ -346,7 +393,7 @@
|
||||
JSON.stringify(selectIds),
|
||||
function (response) {
|
||||
if(response > 0){
|
||||
alert('선택한 임가정보가 삭제되었습니다.');
|
||||
alert('선택한 임가 방문 정보가 삭제되었습니다.');
|
||||
getHouseholdVisitList(document.householdReqForm.page.value);
|
||||
} else {
|
||||
alert('삭제에 실패했습니다.');
|
||||
|
||||
@@ -98,11 +98,15 @@
|
||||
<tr>
|
||||
<th> <label for="inUse">사용여부</label></th>
|
||||
<td>
|
||||
<div class="component-select">
|
||||
<select class="form-select" id="inUse" name="inUse">
|
||||
<option value="true">사용</option>
|
||||
<option value="false">미사용</option>
|
||||
</select>
|
||||
<div class="d-flex">
|
||||
<div class="component-input">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="inUse" name="inUse">
|
||||
<option value="true">사용</option>
|
||||
<option value="false">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -231,13 +235,17 @@
|
||||
const previouslySelected = treeWrap.querySelector('button.selected');
|
||||
if (previouslySelected) {
|
||||
previouslySelected.classList.remove('selected');
|
||||
if (previouslySelected.classList.contains('tit')) {
|
||||
/* if (previouslySelected.classList.contains('tit')) {
|
||||
previouslySelected.parentNode.classList.add('folding');
|
||||
}
|
||||
}*/
|
||||
}
|
||||
button.classList.add('selected');
|
||||
if (button.classList.contains('tit')) {
|
||||
button.parentNode.classList.remove('folding');
|
||||
if(button.parentNode.classList.contains('folding')){
|
||||
button.parentNode.classList.remove('folding');
|
||||
}else{
|
||||
button.parentNode.classList.add('folding');
|
||||
}
|
||||
}
|
||||
// 노드 데이터 추출
|
||||
const data = {
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package app.module.core.config.application.util;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UploadFile;
|
||||
import app.module.core.usecase.file.saveToStorage.ports.application.strategy.SftpConnector;
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SftpFileDeleteUtil {
|
||||
|
||||
private final SftpConnector sftpConnector;
|
||||
|
||||
@Value("${path.upload.sftp.public}")
|
||||
private String publicPath;
|
||||
|
||||
/**
|
||||
* SFTP 서버에서 파일을 삭제하는 공통 메서드
|
||||
* @param deleteFile 삭제할 파일 정보
|
||||
* @throws JSchException SFTP 연결 오류
|
||||
* @throws SftpException SFTP 작업 오류
|
||||
*/
|
||||
public void deleteRealFile(UploadFile deleteFile) throws JSchException, SftpException {
|
||||
if (deleteFile == null || deleteFile.getPath() == null || deleteFile.getName() == null) {
|
||||
log.error("Invalid file information: {}", deleteFile);
|
||||
throw new IllegalArgumentException("Invalid file information");
|
||||
}
|
||||
|
||||
// 경로 검증 및 생성
|
||||
String filePath = constructSafeFilePath(deleteFile.getPath(), deleteFile.getName());
|
||||
log.info("Attempting to delete file from SFTP: {}", filePath);
|
||||
|
||||
// SFTP 연결 확인 및 재연결
|
||||
if (!sftpConnector.isConnected()) {
|
||||
log.warn("SFTP connection lost, attempting to reconnect");
|
||||
sftpConnector.connect();
|
||||
}
|
||||
ChannelSftp channelSftp = sftpConnector.getChannelSftp();
|
||||
if (channelSftp == null) {
|
||||
log.error("SFTP channel is not initialized");
|
||||
throw new SftpException(ChannelSftp.SSH_FX_NO_CONNECTION, "SFTP channel is not initialized");
|
||||
}
|
||||
|
||||
// 파일 삭제
|
||||
try {
|
||||
channelSftp.stat(filePath); // 파일 존재 여부 확인
|
||||
channelSftp.rm(filePath);
|
||||
log.info("File deleted successfully from SFTP: {}", filePath);
|
||||
} catch (SftpException e) {
|
||||
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
|
||||
log.warn("File does not exist on SFTP: {}", filePath);
|
||||
} else {
|
||||
log.error("Failed to delete file from SFTP: {}, error: {}", filePath, e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 경로 조작 방지를 위해 안전한 파일 경로 생성
|
||||
*/
|
||||
private String constructSafeFilePath(String subPath, String fileName) {
|
||||
// 경로 및 파일 이름 정규화
|
||||
String normalizedSubPath = Paths.get(subPath).normalize().toString().replace("\\", "/");
|
||||
String normalizedFileName = Paths.get(fileName).getFileName().toString();
|
||||
String safePath = CommonUtil.removeLastChar(publicPath, "/") + "/" + normalizedSubPath + "/" + normalizedFileName;
|
||||
|
||||
// 경로가 publicPath로 시작하는지 검증
|
||||
if (!safePath.startsWith(publicPath)) {
|
||||
log.error("Invalid file path detected: {}", safePath);
|
||||
throw new IllegalArgumentException("Invalid file path: " + safePath);
|
||||
}
|
||||
|
||||
return safePath;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package app.module.front.config.application.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DailyUtil {
|
||||
|
||||
/**
|
||||
* int -> localdate
|
||||
* @param month 월(yyyyMM)
|
||||
* @param day 일(d)
|
||||
* @return LocalDate
|
||||
*/
|
||||
public LocalDate getDayToLocalDate(String month, int day) {
|
||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
||||
|
||||
try {
|
||||
Date formatDate = beforeSdf.parse(month + String.format("%02d", day));
|
||||
|
||||
return LocalDate.parse(afterSdf.format(formatDate));
|
||||
} catch (Exception e) {
|
||||
log.warn("[DailyUtil][getDayToLocalDate] month={}, day={}", month, day, e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 마지막 일 여부
|
||||
*
|
||||
* @param searchDate 종료일(yyyy-MM-dd)
|
||||
* @return true=마지막 일, false=마지막 일 아님
|
||||
*/
|
||||
public boolean isLastDay(LocalDate searchDate) {
|
||||
if (searchDate != null) {
|
||||
LocalDate lastDate = searchDate.withDayOfMonth(searchDate.lengthOfMonth());
|
||||
|
||||
return searchDate == lastDate;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검색 일의 마지막 일 조회
|
||||
* @param searchDate 검색
|
||||
* @return 마지막 일
|
||||
*/
|
||||
public int getLastDay(LocalDate searchDate) {
|
||||
return searchDate.withDayOfMonth(searchDate.lengthOfMonth()).getDayOfMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
* 자가농업 항목 오픈 여부
|
||||
* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날
|
||||
*
|
||||
* @param groupNo
|
||||
* @param searchDate 종료일
|
||||
* @return true=대상, false=대상 아님
|
||||
*/
|
||||
public boolean isFarmingOpen(int groupNo, LocalDate searchDate) {
|
||||
return groupNo == 4 || groupNo == 8 || groupNo == 12 || isLastDay(searchDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
* [정책] 15일전까지 데이터 수정 가능(등록도 불가)
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return true=수정 가능, false=수정 불가
|
||||
*/
|
||||
public boolean isModifiable(LocalDate startDate, LocalDate endDate) {
|
||||
// TODO : 15일로 변경, 테스트를 위해 30일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(30);
|
||||
log.debug("isModifiable @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 등록 가능 여부
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
public boolean isRegisterPossible(LocalDate startDate, LocalDate endDate) {
|
||||
// TODO : 15일로 변경, 테스트를 위해 60일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(60);
|
||||
log.debug("isRegisterPossible @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.calendar.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.front.config.application.util.DailyUtil;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
|
||||
@@ -9,8 +10,10 @@ import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -26,6 +29,7 @@ import java.util.Objects;
|
||||
public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
private final RecordCalendarMapper recordCalendarMapper;
|
||||
private final DailyRecordMapper dailyRecordMapper;
|
||||
private final DailyUtil dailyUtil;
|
||||
|
||||
@Override
|
||||
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||
@@ -39,12 +43,14 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
monthlyList.add(new CalendarChildren(
|
||||
"MONTHLY",
|
||||
"임산물 현황 등록",
|
||||
null, // TODO
|
||||
monthlyStatus.isForestNone() ? 0 : 1,
|
||||
monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||
|
||||
monthlyList.add(new CalendarChildren(
|
||||
"BANK",
|
||||
"은행 자동이체 내역 등록",
|
||||
null, // TODO
|
||||
monthlyStatus.isBankNone() ? 0 : 1,
|
||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
||||
|
||||
@@ -54,6 +60,11 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
refine.setNo(calendar.getGroupNo());
|
||||
refine.setStart(calendar.getStartDay());
|
||||
refine.setEnd(calendar.getEndDay());
|
||||
refine.setStartDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getStartDay()));
|
||||
refine.setEndDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getEndDay()));
|
||||
|
||||
refine.setRegistrable(dailyUtil.isRegisterPossible(refine.getStartDate(), refine.getEndDate()));
|
||||
refine.setModifiable(dailyUtil.isModifiable(refine.getStartDate(), refine.getEndDate()));
|
||||
|
||||
DailyRecordStatusDto findStatus = statusList.stream()
|
||||
.filter(f -> Objects.equals(calendar.getDailyId(), f.getDailyId()))
|
||||
@@ -61,53 +72,62 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
if (findStatus == null) {
|
||||
refine.setChildren(new ArrayList<>());
|
||||
if (!dailyUtil.isRegisterPossible(refine.getStartDate(), refine.getEndDate())) {
|
||||
childList.addAll(this.getNoneChildList(dailyUtil.isFarmingOpen(refine.getNo(), refine.getEndDate())));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getIncomeStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"INCOME",
|
||||
"수입",
|
||||
DailySort.INCOME.name(),
|
||||
DailySort.INCOME.getDesc(),
|
||||
findStatus.getIncomeStatus(),
|
||||
findStatus.getIncomeCount(),
|
||||
String.format(pathFormat, "income", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getWorkStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"WORK",
|
||||
"임업노동 투입 내역",
|
||||
DailySort.WORK.name(),
|
||||
DailySort.WORK.getDesc(),
|
||||
findStatus.getWorkStatus(),
|
||||
findStatus.getWorkCount(),
|
||||
String.format(pathFormat, "work", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getExpenseStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"EXPENSE",
|
||||
"지출",
|
||||
DailySort.EXPENSE.name(),
|
||||
DailySort.EXPENSE.getDesc(),
|
||||
findStatus.getExpenseStatus(),
|
||||
findStatus.getExpenseCount(),
|
||||
String.format(pathFormat, "expense", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getPowerStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"POWER",
|
||||
"동력 사용시간",
|
||||
DailySort.POWER.name(),
|
||||
DailySort.POWER.getDesc(),
|
||||
findStatus.getPowerStatus(),
|
||||
findStatus.getPowerCount(),
|
||||
String.format(pathFormat, "power", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getForestryStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"FORESTRY",
|
||||
"자가임업 생산물 중 자가소비량",
|
||||
DailySort.FORESTRY.name(),
|
||||
DailySort.FORESTRY.getDesc(),
|
||||
findStatus.getForestryStatus(),
|
||||
findStatus.getForestryCount(),
|
||||
String.format(pathFormat, "forestry", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getFarmingStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"FARMING",
|
||||
"자가농업 생산물 중 자가소비량",
|
||||
DailySort.FARMING.name(),
|
||||
DailySort.FARMING.getDesc(),
|
||||
findStatus.getFarmingStatus(),
|
||||
findStatus.getFarmingCount(),
|
||||
String.format(pathFormat, "farming", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
@@ -121,6 +141,23 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
return refineList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 미작성 목록 조회
|
||||
*
|
||||
* @param farmingOpen
|
||||
* @return 미작성 목록
|
||||
*/
|
||||
private List<CalendarChildren> getNoneChildList(boolean farmingOpen) {
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
if (!DailySort.FARMING.equals(type) || (DailySort.FARMING.equals(type) && farmingOpen)) {
|
||||
childList.add(new CalendarChildren(type.name(),type.getDesc()));
|
||||
}
|
||||
}
|
||||
|
||||
return childList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDataNoneCountBySomeDayAfter(RecordCalendarCmd command) {
|
||||
int dataNoneCount = recordCalendarMapper.getDataNoneCountBySomeDayAfter(command);
|
||||
@@ -158,14 +195,17 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
List<DailyRecordCalendarDto> calendarList = recordCalendarMapper.getCalendarByDailyRecord(command);
|
||||
|
||||
List<DailyRecordCalendarDto> refineList = new ArrayList<>();
|
||||
for (DailyRecordCalendarDto record : calendarList) {
|
||||
record.setStartDate(command.getSearchMonth() + String.format("%02d", record.getStartDay()));
|
||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||
LocalDate startDate = dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getStartDay());
|
||||
LocalDate endDate = dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getEndDay());
|
||||
int lastDay = dailyUtil.getLastDay(startDate);
|
||||
calendar.setStartDate(startDate.toString());
|
||||
|
||||
if ((command.getLastDay() == 28 || command.getLastDay() == 30) && record.getStartDay() == command.getLastDay()) {
|
||||
record.setEndDay(command.getLastDay());
|
||||
refineList.add(record);
|
||||
} else if (record.getStartDay() <= command.getLastDay() && record.getEndDay() <= command.getLastDay()) {
|
||||
refineList.add(record);
|
||||
if ((lastDay == 28 || lastDay == 30) && calendar.getStartDay() == lastDay) {
|
||||
calendar.setEndDay(lastDay);
|
||||
refineList.add(calendar);
|
||||
} else if (calendar.getStartDay() <= lastDay && calendar.getEndDay() <= lastDay) {
|
||||
refineList.add(calendar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,7 @@ public class RecordCalendarController {
|
||||
|
||||
List<RecordCalendar> calendarList = recordCalendarPortIn.operate(new RecordCalendarCmd(
|
||||
reqVO.getSearchMonth(),
|
||||
reqVO.getHouseholdSeq(),
|
||||
reqVO.getSearchDate().withDayOfMonth(reqVO.getSearchDate().lengthOfMonth()).getDayOfMonth()
|
||||
reqVO.getHouseholdSeq()
|
||||
));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(calendarList);
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.front.usecase.daily.calendar.ports.application;
|
||||
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,20 +18,22 @@ public class RecordCalendarService implements RecordCalendarPortIn {
|
||||
|
||||
@Override
|
||||
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||
return portOut.operate(command);
|
||||
List<RecordCalendar> list = portOut.operate(command);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDataNoneCountBySomeDayAfter() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getDataNoneCountBySomeDayAfter(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
return portOut.getDataNoneCountBySomeDayAfter(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLatestDate() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getLatestDate(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
return portOut.getLatestDate(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,45 @@
|
||||
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class CalendarChildren {
|
||||
public CalendarChildren() {
|
||||
}
|
||||
|
||||
public CalendarChildren(String code, String codeLabel) {
|
||||
this.code = code;
|
||||
this.codeLabel = codeLabel;
|
||||
}
|
||||
|
||||
public CalendarChildren(String code, String codeLabel, DailyTargetStatus status, Integer total, String path) {
|
||||
this.code = code;
|
||||
this.codeLabel = codeLabel;
|
||||
this.status = status;
|
||||
this.total = total;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목 코드
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 항목명
|
||||
*/
|
||||
private String codeLabel;
|
||||
private Integer total;
|
||||
/**
|
||||
* 상태
|
||||
*/
|
||||
private DailyTargetStatus status;
|
||||
/**
|
||||
* 등록 건수
|
||||
*/
|
||||
private int total;
|
||||
/**
|
||||
* 수정 페이지 경로
|
||||
*/
|
||||
private String path;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -14,6 +16,13 @@ public class RecordCalendar {
|
||||
private Integer no;
|
||||
private Integer start;
|
||||
private Integer end;
|
||||
//TODO : JsonIgnore
|
||||
// @JsonIgnore
|
||||
private LocalDate startDate;
|
||||
@JsonIgnore
|
||||
private LocalDate endDate;
|
||||
private boolean isRegistrable;
|
||||
private boolean isModifiable;
|
||||
private List<CalendarChildren> children;
|
||||
private List<CalendarChildren> monthly;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,4 @@ public class RecordCalendarCmd {
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
/**
|
||||
* 특정월의 마지막 일
|
||||
*/
|
||||
private int lastDay;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyExpenseUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyExpenseUIReqVO reqVO = new DailyExpenseUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyExpenseUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("expenseList", expenseList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/expense/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyExpenseUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyExpenseUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.EXPENSE);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyFarmingUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyFarmingUIReqVO reqVO = new DailyFarmingUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyFarmingUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("farmingList", farmingList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/farming/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyFarmingUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyFarmingUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.FARMING);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyForestryUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyForestryUIReqVO reqVO = new DailyForestryUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyForestryUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("forestryList", forestryList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/forestry/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyForestryUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyForestryUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.FORESTRY);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -11,14 +11,15 @@ import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyIncomeUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("incomeList", incomeList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/income/index";
|
||||
}
|
||||
@@ -70,7 +74,8 @@ public class DailyIncomeUIController {
|
||||
, @PathVariable("id") String id) {
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO(searchMonth, groupNo);
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
|
||||
if (StringUtils.isBlank(id)) {
|
||||
reqVO.setId(0L);
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
@@ -100,7 +105,7 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +114,20 @@ public class DailyIncomeUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.INCOME);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -35,12 +36,14 @@ public class DailyPowerUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyPowerUIReqVO reqVO = new DailyPowerUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -50,7 +53,8 @@ public class DailyPowerUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("powerList", powerList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/power/index";
|
||||
}
|
||||
@@ -95,7 +99,7 @@ public class DailyPowerUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -104,6 +108,20 @@ public class DailyPowerUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.POWER);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.record.adapters.persistence;
|
||||
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.config.application.util.DailyUtil;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus;
|
||||
@@ -24,29 +25,29 @@ import java.util.Locale;
|
||||
@RequiredArgsConstructor
|
||||
public class DailyRecordDao implements DailyRecordPortOut {
|
||||
private final DailyRecordMapper dailyRecordMapper;
|
||||
private final DailyUtil dailyUtil;
|
||||
|
||||
@Override
|
||||
public DailyRecordDto detail(GetDailyRecordCmd command) {
|
||||
DailyRecordDto detail = dailyRecordMapper.getDailyRecord(command);
|
||||
if (detail != null && detail.getStartDate() == null) {
|
||||
try {
|
||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
||||
|
||||
Date formatDate = beforeSdf.parse(command.getSearchMonth() + String.format("%02d", detail.getStartDay()));
|
||||
detail.setStartDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||
|
||||
formatDate = beforeSdf.parse(command.getSearchMonth() + String.format("%02d", detail.getEndDay()));
|
||||
detail.setEndDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||
|
||||
if (detail != null) {
|
||||
if (detail.getStartDate() == null) {
|
||||
detail.setStartDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), detail.getStartDay()));
|
||||
detail.setEndDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), detail.getEndDay()));
|
||||
if (detail.getStartDate().getMonth() != detail.getEndDate().getMonth()) {
|
||||
// 종료일의 달이 변경되면 시작일=종료일 처리
|
||||
detail.setEndDate(detail.getStartDate());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("[DateParse] target={}", detail.getStartDay(), e);
|
||||
}
|
||||
|
||||
detail.setLastDay(dailyUtil.isLastDay(detail.getEndDate()));
|
||||
detail.setFarmingOpen(dailyUtil.isFarmingOpen(detail.getGroupNo(), detail.getEndDate()));
|
||||
detail.setRegistrable(dailyUtil.isRegisterPossible(detail.getStartDate(), detail.getEndDate()));
|
||||
detail.setModifiable(dailyUtil.isModifiable(detail.getStartDate(), detail.getEndDate()));
|
||||
}
|
||||
|
||||
log.debug("detail: {}", detail);
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,50 +37,26 @@ public class DailyRecordDto {
|
||||
*/
|
||||
private boolean farmingOpen;
|
||||
/**
|
||||
* 특정일의 데이터 등록 대상 항목
|
||||
* 데이터 등록 가능 여부
|
||||
*/
|
||||
private List<DailySort> targetList;
|
||||
private boolean registrable;
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
*/
|
||||
private boolean modifiable;
|
||||
|
||||
/**
|
||||
* 현재 단계
|
||||
*/
|
||||
private DailySort currentStep;
|
||||
|
||||
/**
|
||||
* 마지막 일 여부
|
||||
* @return true=마지막 일, false=마지막 일 아님
|
||||
* 특정일의 데이터 등록 대상 항목
|
||||
*/
|
||||
public boolean isLastDay() {
|
||||
if (endDate != null) {
|
||||
LocalDate lastDate = endDate.withDayOfMonth(endDate.lengthOfMonth());
|
||||
|
||||
return endDate == lastDate;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<DailySort> targetList;
|
||||
/**
|
||||
* 자가농업 항목 오픈 여부
|
||||
* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날
|
||||
* @return true=대상, false=대상 아님
|
||||
* 다음 단계로 이동될 단계 대상 항목
|
||||
*/
|
||||
public boolean isFarmingOpen() {
|
||||
return groupNo == 4 || groupNo == 8 || groupNo == 12 || isLastDay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
* [정책] 15일전까지 데이터 수정 가능(등록도 불가)
|
||||
* @return true=수정 가능, false=수정 불가
|
||||
*/
|
||||
public boolean isModifiable() {
|
||||
// TODO : 15일로 변경, 테스트를 위해 30일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(30);
|
||||
log.debug("@@limitStart: {}", limitStart);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
|
||||
private List<DailySort> stepList;
|
||||
/**
|
||||
* 다음 단계로 이동될 단계 조회
|
||||
*
|
||||
@@ -88,12 +64,12 @@ public class DailyRecordDto {
|
||||
*/
|
||||
public String getNextStep() {
|
||||
String returnValue = null;
|
||||
if (targetList != null) {
|
||||
if (stepList != null) {
|
||||
int index = 0;
|
||||
int size = targetList.size();
|
||||
for (DailySort target : targetList) {
|
||||
int size = stepList.size();
|
||||
for (DailySort target : stepList) {
|
||||
if (target.equals(currentStep) && (index + 1) != size) {
|
||||
returnValue = targetList.get(index + 1).name();
|
||||
returnValue = stepList.get(index + 1).name();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DailyRecordController {
|
||||
formVO.setDayGroupNo(reqVO.getGroupNo());
|
||||
formVO.setStartDate(detail.getStartDate());
|
||||
formVO.setEndDate(detail.getEndDate());
|
||||
formVO.setFarmingStatus(detail.isFarmingOpen());
|
||||
formVO.setFarming(detail.isFarmingOpen());
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
dailyRecordPortIn.create(formVO);
|
||||
|
||||
@@ -22,8 +22,14 @@ public class CreateDailyRecordReqVO {
|
||||
private DailyTargetStatus forestryStatus;
|
||||
private DailyTargetStatus farmingStatus;
|
||||
|
||||
/**
|
||||
* 금일 데이터 없음으로 각 항목 상태 일괄 변경
|
||||
*
|
||||
* @param todayNone 상태
|
||||
*/
|
||||
public void setTodayNone(String todayNone) {
|
||||
this.todayNone = todayNone;
|
||||
|
||||
if ("Y".equals(todayNone)) {
|
||||
this.allStatus = DailyStatus.TODAY_NONE;
|
||||
this.incomeStatus = DailyTargetStatus.TODAY_NONE;
|
||||
@@ -35,32 +41,37 @@ public class CreateDailyRecordReqVO {
|
||||
this.allStatus = DailyStatus.WAITING;
|
||||
|
||||
if (incomeStatus == null) {
|
||||
this.incomeStatus = DailyTargetStatus.NONE;
|
||||
this.incomeStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (workStatus == null) {
|
||||
this.workStatus = DailyTargetStatus.NONE;
|
||||
this.workStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (expenseStatus == null) {
|
||||
this.expenseStatus = DailyTargetStatus.NONE;
|
||||
this.expenseStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (powerStatus == null) {
|
||||
this.powerStatus = DailyTargetStatus.NONE;
|
||||
this.powerStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (forestryStatus == null) {
|
||||
this.forestryStatus = DailyTargetStatus.NONE;
|
||||
this.forestryStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setFarmingStatus(boolean isOpen) {
|
||||
if ("Y".equals(todayNone)) {
|
||||
/**
|
||||
* 농업 생산물 입력 상태 변경
|
||||
*
|
||||
* @param isOpen 자가농업 항목 오픈 여부
|
||||
*/
|
||||
public void setFarming(boolean isOpen) {
|
||||
if (farmingStatus == null) {
|
||||
if (isOpen) {
|
||||
this.farmingStatus = DailyTargetStatus.TODAY_NONE;
|
||||
} else {
|
||||
this.farmingStatus = DailyTargetStatus.NONE;
|
||||
}
|
||||
} else if (farmingStatus == null) {
|
||||
this.farmingStatus = DailyTargetStatus.NONE;
|
||||
} else {
|
||||
this.farmingStatus = DailyTargetStatus.TARGET;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class DailyCmd {
|
||||
/**
|
||||
* 검색 월(yyyyMM)
|
||||
*/
|
||||
private String searchMonth;
|
||||
/**
|
||||
* 검색 그룸번호
|
||||
*/
|
||||
private Integer groupNo;
|
||||
/**
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
public enum DailyStatus {
|
||||
/**
|
||||
* 입력중
|
||||
* 미완료
|
||||
*/
|
||||
WAITING,
|
||||
/**
|
||||
|
||||
@@ -2,20 +2,16 @@ package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
public enum DailyTargetStatus {
|
||||
/**
|
||||
* 등록 대상
|
||||
* 등록 대상 (테이터 건 수 체크)
|
||||
*/
|
||||
TARGET,
|
||||
/**
|
||||
* 금일 없음
|
||||
* 금일 없음 (데이터 건 수 체크하지 않음)
|
||||
*/
|
||||
TODAY_NONE,
|
||||
/**
|
||||
* 등록 없음
|
||||
* 대상 아님
|
||||
*/
|
||||
NONE,
|
||||
// /**
|
||||
// * 등록 완료
|
||||
// */
|
||||
// DONE,
|
||||
;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyWorkUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyWorkUIReqVO reqVO = new DailyWorkUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyWorkUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("workList", workList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/work/index";
|
||||
}
|
||||
@@ -101,7 +105,7 @@ public class DailyWorkUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -110,6 +114,20 @@ public class DailyWorkUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.WORK);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -27,7 +27,7 @@ krip.daily.goToPrev = function() {
|
||||
* @param searchMonth
|
||||
* @param groupNo
|
||||
*/
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo, targetList) {
|
||||
if (target == null) {
|
||||
if ($('._nextStep').data('last')) {
|
||||
target = 'LAST';
|
||||
@@ -53,7 +53,7 @@ krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target.toLowerCase());
|
||||
|
||||
location.href = url;
|
||||
location.href = url + '?type=step&target=' + (targetList !== undefined ? targetList : '');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ krip.daily.goToDone = function(searchMonth, groupNo) {
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
|
||||
location.replace(url);
|
||||
location.href = url;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -769,10 +769,6 @@
|
||||
if (rowdata == null) {
|
||||
kri.logger.error('달력 선택 데이터 없음.')
|
||||
}
|
||||
// if (rowdata != null && typeof rowdata === 'object' && rowdata.children !== undefined) {
|
||||
// rowList = rowdata.children.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
||||
// monthlyList = rowdata.children.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
||||
// }
|
||||
|
||||
let tmpl = $.templates('#dailyNoneTmpl');
|
||||
let html = '';
|
||||
@@ -782,6 +778,8 @@
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
} else {
|
||||
tmpl = $.templates('#dailyListTmpl');
|
||||
@@ -791,6 +789,8 @@
|
||||
date: currentDate,
|
||||
list: childList,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -804,11 +804,13 @@
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
{{if registrable}}
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button" onclick="formControl.recordCreate('{{:month}}', {{:no}});">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
@@ -816,7 +818,11 @@
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{for list tmpl="#basicRowTmpl" /}}
|
||||
{{if modifiable}}
|
||||
{{for list tmpl="#basicRowTmpl1" /}}
|
||||
{{else}}
|
||||
{{for list tmpl="#basicRowTmpl2" /}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
@@ -828,24 +834,42 @@
|
||||
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script id="basicRowTmpl" type="text/x-jsrender">
|
||||
<script id="basicRowTmpl1" type="text/x-jsrender">
|
||||
<li>
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
{{if status == null}}
|
||||
<p class="value">미작성</p>
|
||||
{{else status == 'TARGET' && total != 0}}
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
{{else}}
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<p class="value">미완료</p>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<p class="value">없음</p>
|
||||
{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
<script id="basicRowTmpl2" type="text/x-jsrender">
|
||||
<li>
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}, TODO: 수정버튼삭제필요</p>
|
||||
{{if status == null}}
|
||||
<p class="value">미작성</p>
|
||||
{{else status == 'TARGET' && total != 0}}
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<p class="value">미완료</p>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<p class="value">없음</p>
|
||||
{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for monthlyList}}
|
||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
|
||||
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<ul class="detail-list"
|
||||
th:if="${item.name eq 'WORK'}"
|
||||
>
|
||||
<th:block th:if="${#strings.isEmpty(workList)}">
|
||||
<th:block th:if="${#lists.isEmpty(workList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
</main>
|
||||
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable}">
|
||||
th:if="${dailyRecord.registrable || dailyRecord.modifiable}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-primary _nextStep"
|
||||
th:data-last="${dailyRecord.lastDay}"
|
||||
@@ -164,11 +164,16 @@
|
||||
create() {
|
||||
const f = document.reqForm;
|
||||
|
||||
let checkedArray = [];
|
||||
const $checked = $(f).find('input:checked');
|
||||
if ($checked.length === 0) {
|
||||
f.todayNone.value = 'Y';
|
||||
}
|
||||
|
||||
$(f).find('input:checked').each(function() {
|
||||
checkedArray.push($(this).data('target'));
|
||||
})
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.create,
|
||||
@@ -176,12 +181,12 @@
|
||||
function () {
|
||||
if (f.todayNone.value === 'Y') {
|
||||
if ($('._nextStep').data('last')) {
|
||||
krip.daily.goToNext('LAST', ENV.month, ENV.groupNo);
|
||||
krip.daily.goToNext('LAST', ENV.month, ENV.groupNo, checkedArray.join(','));
|
||||
} else {
|
||||
krip.daily.goToDone(ENV.month, ENV.groupNo);
|
||||
}
|
||||
} else if ($checked.data('target') !== undefined) {
|
||||
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo);
|
||||
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo, checkedArray.join(','));
|
||||
} else {
|
||||
krip.daily.goToMain();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="EXPENSE"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -47,7 +49,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(expenseList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -58,7 +60,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.expenseKind}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -98,7 +100,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -3,9 +3,19 @@
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
[[${dailyRecord.registrable}]]
|
||||
[[${moveStep}]],
|
||||
[[${dailyRecord.modifiable}]]
|
||||
--
|
||||
[[${(not dailyRecord.modifiable)}]]
|
||||
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
|
||||
[[${btnActive}]], [[${btnDisabled}]], [[${btnIcoClass}]]
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
@@ -33,7 +43,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="FARMING"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -53,7 +63,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(farmingList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -64,7 +74,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productLabel}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -101,14 +111,14 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
th:disabled="${not #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) and #lists.isEmpty(farmingList)}"
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]], [[${targetList}]])">
|
||||
<span class="btn-txt">다음 단계로 이동</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="FORESTRY"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -53,7 +55,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(forestryList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -64,7 +66,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -3,8 +3,25 @@
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<div>
|
||||
reqVO: [[${reqVO}]]
|
||||
</div>
|
||||
<div>
|
||||
detail: [[${dailyRecord}]]
|
||||
</div>
|
||||
<div>
|
||||
[[${dailyRecord.registrable}]]
|
||||
[[${moveStep}]],
|
||||
[[${dailyRecord.modifiable}]]
|
||||
<br>
|
||||
//http://localhost:8080/record/income/202505/12?type=step1&target=income
|
||||
</div>
|
||||
</th:block>
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
@@ -34,7 +51,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="INCOME"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -48,7 +65,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -59,7 +76,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.incomeKind}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -94,7 +111,7 @@
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-add ico-small" aria-hidden="true"></i>
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</button>
|
||||
@@ -105,14 +122,14 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) and #lists.isEmpty(incomeList)}"
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]], [[${targetList}]])">
|
||||
<span class="btn-txt">다음 단계로 이동</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="POWER"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -47,7 +49,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(powerList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -58,7 +60,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.equipmentName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -86,7 +88,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<main id="content" role="main"
|
||||
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="WORK"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -55,7 +57,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(workList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -66,7 +68,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.itemName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
@@ -147,7 +149,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
Reference in New Issue
Block a user