diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/ResultController.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/ResultController.java index 99b9d012..37fc1d3d 100644 --- a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/ResultController.java +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/ResultController.java @@ -3,6 +3,8 @@ package com.dbnt.faisp.fpiMgt.affairResult; import com.dbnt.faisp.authMgt.service.AuthMgtService; import com.dbnt.faisp.fpiMgt.affairResult.model.ResultApprv; import com.dbnt.faisp.fpiMgt.affairResult.model.ResultBoard; +import com.dbnt.faisp.fpiMgt.affairResult.model.ClearInfo; +import com.dbnt.faisp.fpiMgt.affairResult.model.ResultInfo; import com.dbnt.faisp.fpiMgt.affairResult.service.ResultService; import com.dbnt.faisp.userInfo.model.UserInfo; import lombok.RequiredArgsConstructor; @@ -178,12 +180,11 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관 @PostMapping("/saveResult") public Integer saveResult(ResultBoard resultBoard, - @RequestParam(value = "resultInfos", required = false) List resultInfos, - @RequestParam(value = "detailResultInfos", required = false)List detailResultInfos, MultipartHttpServletRequest request, @RequestParam(value = "fileSeq", required = false) List deleteFileSeq){ resultBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); - return resultService.saveResultBoard(resultBoard, resultInfos, detailResultInfos, deleteFileSeq); + return 0; + // return resultService.saveResultBoard(resultBoard, deleteFileSeq); } @@ -194,4 +195,17 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관 apprv.setSaveDt(LocalDateTime.now()); return resultService.resultStateChange(apprv); } + + @GetMapping("/getClearInfoRow") + public ModelAndView getClearInfoRow(ClearInfo info){ + ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairResult/clearInfoRow"); + mav.addObject("info", info); + return mav; + } + @GetMapping("/getResultInfoRow") + public ModelAndView getResultInfoRow(ResultInfo info){ + ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairResult/resultInfoRow"); + mav.addObject("info", info); + return mav; + } } diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ClearInfo.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ClearInfo.java new file mode 100644 index 00000000..f5466b83 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ClearInfo.java @@ -0,0 +1,41 @@ +package com.dbnt.faisp.fpiMgt.affairResult.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "clear_info") +@IdClass(ClearInfo.ClearInfoId.class) +public class ClearInfo { + @Id + @Column(name = "result_key") + private Integer resultKey; + @Id + @Column(name = "info_seq") + private Integer infoSeq; + @Column(name = "use_catg") + private String useCatg; + @Column(name = "use_detail") + private String userDetail; + @Column(name = "price") + private Double price; + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class ClearInfoId implements Serializable { + private Integer resultKey; + private Integer infoSeq; + } +} diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultBoard.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultBoard.java index be232e96..a97be41a 100644 --- a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultBoard.java +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultBoard.java @@ -32,16 +32,26 @@ public class ResultBoard extends BaseModel { private String clearTitle; @Column(name = "result_title") private String resultTitle; - @Column(name = "start_dt") + @Column(name = "use_start_dt") @DateTimeFormat(pattern = "yyyy-MM-dd") - private LocalDate startDt; - @Column(name = "end_dt") + private LocalDate useStartDt; + @Column(name = "use_end_dt") @DateTimeFormat(pattern = "yyyy-MM-dd") - private LocalDate endDt; + private LocalDate useEndDt; + @Column(name = "work_start_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate workStartDt; + @Column(name = "work_end_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate workEndDt; @Column(name = "plan_price") private Double planPrice; @Column(name = "use_price") private Double usePrice; + @Column(name="result_etc") + private String resultEtc; + @Column(name="clear_etc") + private String clearEtc; @Column(name = "wrt_organ") private String wrtOrgan; @Column(name = "wrt_part") @@ -56,6 +66,7 @@ public class ResultBoard extends BaseModel { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime wrtDt; + @Transient private String userType; @Transient @@ -66,5 +77,8 @@ public class ResultBoard extends BaseModel { private List fileList; @Transient private List multipartFileList; - + @Transient + private List clearInfoList; + @Transient + private List resultInfoList; } diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultInfo.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultInfo.java new file mode 100644 index 00000000..bb463533 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultInfo.java @@ -0,0 +1,38 @@ +package com.dbnt.faisp.fpiMgt.affairResult.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "result_info") +@IdClass(ResultInfo.ResultInfoId.class) +public class ResultInfo { + @Id + @Column(name = "result_key") + private Integer resultKey; + @Id + @Column(name = "info_seq") + private Integer infoSeq; + @Column(name = "contact_target") + private String contactTarget; + @Column(name = "contact_info") + private String contactInfo; + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class ResultInfoId implements Serializable { + private Integer resultKey; + private Integer infoSeq; + } +} diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToAffair.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToAffair.java new file mode 100644 index 00000000..d8896140 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToAffair.java @@ -0,0 +1,34 @@ +package com.dbnt.faisp.fpiMgt.affairResult.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "result_to_affair") +@IdClass(ResultToAffair.ResultToAffairId.class) +public class ResultToAffair { + @Id + @Column(name = "result_key") + private Integer resultKey; + @Id + @Column(name = "affair_key") + private Integer affairKey; + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class ResultToAffairId implements Serializable { + private Integer resultKey; + private Integer affairKey; + } +} diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToPlan.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToPlan.java new file mode 100644 index 00000000..3b284018 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/model/ResultToPlan.java @@ -0,0 +1,34 @@ +package com.dbnt.faisp.fpiMgt.affairResult.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "result_info") +@IdClass(ResultToPlan.ResultToPlanId.class) +public class ResultToPlan { + @Id + @Column(name = "plan_key") + private Integer planKey; + @Id + @Column(name = "result_key") + private Integer resultKey; + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class ResultToPlanId implements Serializable { + private Integer planKey; + private Integer resultKey; + } +} diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/service/ResultService.java b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/service/ResultService.java index fd979a73..6bb81562 100644 --- a/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/service/ResultService.java +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affairResult/service/ResultService.java @@ -45,7 +45,7 @@ public class ResultService extends BaseService { // 월간계획 } @Transactional - public Integer saveResultBoard(ResultBoard resultBoard, List resultInfos, List detailResultInfos, List deleteFileSeq) { + public Integer saveResultBoard(ResultBoard resultBoard, List deleteFileSeq) { Integer resultKey = resultBoardRepository.save(resultBoard).getResultKey(); if(deleteFileSeq != null && deleteFileSeq.size()>0){ deleteResultFile(resultKey, deleteFileSeq); diff --git a/src/main/resources/static/js/igActivities/fpiMgt/result/resultMgt.js b/src/main/resources/static/js/igActivities/fpiMgt/result/resultMgt.js index eb260a36..4ee77bdb 100644 --- a/src/main/resources/static/js/igActivities/fpiMgt/result/resultMgt.js +++ b/src/main/resources/static/js/igActivities/fpiMgt/result/resultMgt.js @@ -29,21 +29,58 @@ $(document).on('click', '#resultAddBtn', function (){ $("#resultDiv").append("") }) -$(document).on('click', '#detailResultAddBtn', function (){ - const detailResultDiv = $("#detailResultDiv"); - detailResultDiv.append(""); - const lastAppendTextarea = detailResultDiv.children()[detailResultDiv.children().length-1]; - $(lastAppendTextarea).summernote({ - lang:'ko-KR', - height: 120, - disableDragAndDrop: true, - toolbar: [ - ['style', ['style']], - ['font', ['bold', 'underline', 'clear']], - ['color', ['color']], - ['para', ['ul', 'ol', 'paragraph']], - ['table', ['table']] - ] +$(document).on('click', '.rowDeleteBtn', function (){ + const isClearInfo = $(this).parents("#clearInfoRow").length !== 0; + const infoSeq = $(this).parents(".infoRow").find(".infoSeq").val(); + $(this).parents(".infoRow").remove(); + if(isClearInfo){ + setInfoSeq($("#clearInfoRow"), infoSeq); + }else{ + setInfoSeq($("#resultInfoRow"), infoSeq); + } +}) + +$(document).on('click', '#clearInfoAddBtn', function (){ + const infoRow = $("#clearInfoRow"); + $.ajax({ + url: '/affairResult/getClearInfoRow', + data: {infoSeq: $(".clearInfoSeq").length}, + type: 'GET', + dataType:"html", + success: function(html){ + infoRow.append(html); + }, + error:function(){ + + } + }); +}) +$(document).on('click', '#resultInfoAddBtn', function (){ + const infoRow = $("#resultInfoRow"); + const infoSeq = $(".resultInfoSeq").length; + $.ajax({ + url: '/affairResult/getResultInfoRow', + data: {infoSeq: infoSeq}, + type: 'GET', + dataType:"html", + success: function(html){ + infoRow.append(html); + $("#contactInfo"+infoSeq).summernote({ + lang:'ko-KR', + height: 60, + disableDragAndDrop: true, + toolbar: [ + ['style', ['style']], + ['font', ['bold', 'underline', 'clear']], + ['color', ['color']], + ['para', ['ul', 'ol', 'paragraph']], + ['table', ['table']] + ] + }); + }, + error:function(){ + + } }); }) @@ -118,18 +155,6 @@ function getResultEditModal(resultKey){ format: "yyyy-mm-dd", language: "ko" }); - $("[name='detailResultInfos']").summernote({ - lang:'ko-KR', - height: 120, - disableDragAndDrop: true, - toolbar: [ - ['style', ['style']], - ['font', ['bold', 'underline', 'clear']], - ['color', ['color']], - ['para', ['ul', 'ol', 'paragraph']], - ['table', ['table']] - ] - }); setUploadDiv(); }, error:function(){ @@ -138,7 +163,7 @@ function getResultEditModal(resultKey){ }); } function saveResult(resultState){ - if(contentCheck()){ + if(resultState === "DST001" || contentCheck()){ if(confirm("저장하시겠습니까?")){ $("#resultState").val(resultState); contentFade("in"); @@ -171,6 +196,17 @@ function saveResult(resultState){ } } +function setInfoSeq(target, infoSeq){ + $.each(target.find("div.infoSeq"), function (idx, child) { + let childInfoSeq = Number(child.innerText); + if(childInfoSeq-->Number(infoSeq)){ + const infoRow = $(child).parent(".infoRow") + child.innerText = childInfoSeq; + infoRow[0].id = "row"+childInfoSeq; + debugger + } + }) +} function contentCheck(){ let flag = true; @@ -184,4 +220,4 @@ function contentCheck(){ } flag = fileCheck(flag, files); return flag; -} \ No newline at end of file +} diff --git a/src/main/resources/templates/igActivities/fpiMgt/affairResult/clearInfoRow.html b/src/main/resources/templates/igActivities/fpiMgt/affairResult/clearInfoRow.html new file mode 100644 index 00000000..a1840692 --- /dev/null +++ b/src/main/resources/templates/igActivities/fpiMgt/affairResult/clearInfoRow.html @@ -0,0 +1,33 @@ + + +
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+
+
\ No newline at end of file diff --git a/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultEditModal.html b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultEditModal.html index a67c5233..3cdbc3a4 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultEditModal.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultEditModal.html @@ -27,59 +27,205 @@
- -
+ +
- -
+ +
- -
-
- - -
-
- -
+ +
- -
-
- - + +
+
+ +
- -
- + +
+
+ + +
- -
- +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
- -
- - - -
-
- + +
+
+
no
+
구분
+
상세
+
금액
+
+
+
+
+ +
+
+
+
+ +
+
-
- -
+
+ +
+
+ +
파일을 업로드 해주세요. +
+ +
+ + 삭제 +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
no
+
접촉 대상자
+
접촉 내용
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+ +
+
+
+
+ + + + + + + + + + + +
작성일자제목활용
+
+
+
+ +

파일을 업로드 해주세요. @@ -95,12 +241,6 @@
-
- -
-
- -
diff --git a/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultInfoRow.html b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultInfoRow.html new file mode 100644 index 00000000..ce83dc76 --- /dev/null +++ b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultInfoRow.html @@ -0,0 +1,15 @@ + + +
+ +
+ + +
+
+ +
+
+ +
+
\ No newline at end of file