견문보고 작업중.
parent
18eed66a0e
commit
cffa53ccb5
|
|
@ -1,9 +1,8 @@
|
||||||
package com.dbnt.faisp.config;
|
package com.dbnt.faisp.config;
|
||||||
|
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.service.MonthPlanService;
|
import com.dbnt.faisp.fpiMgt.monthPlan.service.PlanService;
|
||||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
import com.dbnt.faisp.publicBoard.service.PublicBoardService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
@ -17,7 +16,8 @@ import java.net.URLEncoder;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class FileController {
|
public class FileController {
|
||||||
|
|
||||||
private final MonthPlanService monthPlanService;
|
private final PlanService planService;
|
||||||
|
private final PublicBoardService publicBoardService;
|
||||||
|
|
||||||
@GetMapping("/file/fileDownload")
|
@GetMapping("/file/fileDownload")
|
||||||
public void fileDownload(HttpServletRequest request,
|
public void fileDownload(HttpServletRequest request,
|
||||||
|
|
@ -28,7 +28,10 @@ public class FileController {
|
||||||
FileInfo downloadFile = null;
|
FileInfo downloadFile = null;
|
||||||
switch (board){
|
switch (board){
|
||||||
case "monthPlan":
|
case "monthPlan":
|
||||||
downloadFile = monthPlanService.selectPlanFile(parentKey, fileSeq);
|
downloadFile = planService.selectPlanFile(parentKey, fileSeq);
|
||||||
|
break;
|
||||||
|
case "publicFile":
|
||||||
|
downloadFile = publicBoardService.selectPublicFile(parentKey, fileSeq);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.dbnt.faisp.fpiMgt;
|
package com.dbnt.faisp.fpiMgt;
|
||||||
|
|
||||||
import com.dbnt.faisp.authMgt.service.AuthMgtService;
|
import com.dbnt.faisp.authMgt.service.AuthMgtService;
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.service.AffairService;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanApprv;
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanApprv;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.service.MonthPlanService;
|
import com.dbnt.faisp.fpiMgt.monthPlan.service.PlanService;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanBoard;
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanBoard;
|
||||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -19,8 +20,9 @@ import java.util.Map;
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/fpiMgt")
|
@RequestMapping("/fpiMgt")
|
||||||
public class FpiMgtController { // 외사경찰견문관리
|
public class FpiMgtController { // 첩보수집활동
|
||||||
private final MonthPlanService monthPlanService;
|
private final PlanService planService;
|
||||||
|
private final AffairService affairService;
|
||||||
private final AuthMgtService authMgtService;
|
private final AuthMgtService authMgtService;
|
||||||
|
|
||||||
@GetMapping("/monthPlanPage")
|
@GetMapping("/monthPlanPage")
|
||||||
|
|
@ -46,8 +48,8 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
mav.addObject("accessAuth", accessAuth);
|
mav.addObject("accessAuth", accessAuth);
|
||||||
mav.addObject("apprvAuth", apprvAuth);
|
mav.addObject("apprvAuth", apprvAuth);
|
||||||
planBoard.setQueryInfo();
|
planBoard.setQueryInfo();
|
||||||
mav.addObject("planList", monthPlanService.selectPlanBoardList(planBoard));
|
mav.addObject("planList", planService.selectPlanBoardList(planBoard));
|
||||||
planBoard.setContentCnt(monthPlanService.selectPlanBoardListCnt(planBoard));
|
planBoard.setContentCnt(planService.selectPlanBoardListCnt(planBoard));
|
||||||
planBoard.setPaginationInfo();
|
planBoard.setPaginationInfo();
|
||||||
mav.addObject("searchParams", planBoard);
|
mav.addObject("searchParams", planBoard);
|
||||||
return mav;
|
return mav;
|
||||||
|
|
@ -57,7 +59,7 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
public ModelAndView planEditModal(@AuthenticationPrincipal UserInfo loginUser, PlanBoard planBoard){
|
public ModelAndView planEditModal(@AuthenticationPrincipal UserInfo loginUser, PlanBoard planBoard){
|
||||||
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairPlan/planEditModal");
|
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairPlan/planEditModal");
|
||||||
if(planBoard.getPlanKey()!=null){
|
if(planBoard.getPlanKey()!=null){
|
||||||
planBoard = monthPlanService.selectPlanBoard(planBoard.getPlanKey());
|
planBoard = planService.selectPlanBoard(planBoard.getPlanKey());
|
||||||
}else{
|
}else{
|
||||||
planBoard.setWrtOrgan(loginUser.getOgCd());
|
planBoard.setWrtOrgan(loginUser.getOgCd());
|
||||||
planBoard.setWrtPart(loginUser.getOfcCd());
|
planBoard.setWrtPart(loginUser.getOfcCd());
|
||||||
|
|
@ -72,7 +74,7 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
@GetMapping("/planViewModal")
|
@GetMapping("/planViewModal")
|
||||||
public ModelAndView planViewModal(@AuthenticationPrincipal UserInfo loginUser, PlanBoard planBoard){
|
public ModelAndView planViewModal(@AuthenticationPrincipal UserInfo loginUser, PlanBoard planBoard){
|
||||||
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairPlan/planViewModal");
|
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairPlan/planViewModal");
|
||||||
planBoard = monthPlanService.selectPlanBoard(planBoard.getPlanKey());
|
planBoard = planService.selectPlanBoard(planBoard.getPlanKey());
|
||||||
mav.addObject("plan", planBoard);
|
mav.addObject("plan", planBoard);
|
||||||
mav.addObject("userSeq",loginUser.getUserSeq());
|
mav.addObject("userSeq",loginUser.getUserSeq());
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
|
@ -91,7 +93,7 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
MultipartHttpServletRequest request,
|
MultipartHttpServletRequest request,
|
||||||
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){
|
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){
|
||||||
planBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
|
planBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
|
||||||
return monthPlanService.savePlanBoard(planBoard, planInfos, detailPlanInfos, deleteFileSeq);
|
return planService.savePlanBoard(planBoard, planInfos, detailPlanInfos, deleteFileSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/apprvStayPage")
|
@GetMapping("/apprvStayPage")
|
||||||
|
|
@ -137,8 +139,8 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
mav.addObject("accessAuth", accessAuth);
|
mav.addObject("accessAuth", accessAuth);
|
||||||
mav.addObject("apprvAuth", apprvAuth);
|
mav.addObject("apprvAuth", apprvAuth);
|
||||||
planBoard.setQueryInfo();
|
planBoard.setQueryInfo();
|
||||||
mav.addObject("planList", monthPlanService.selectPlanBoardList(planBoard));
|
mav.addObject("planList", planService.selectPlanBoardList(planBoard));
|
||||||
planBoard.setContentCnt(monthPlanService.selectPlanBoardListCnt(planBoard));
|
planBoard.setContentCnt(planService.selectPlanBoardListCnt(planBoard));
|
||||||
planBoard.setPaginationInfo();
|
planBoard.setPaginationInfo();
|
||||||
mav.addObject("searchParams", planBoard);
|
mav.addObject("searchParams", planBoard);
|
||||||
return mav;
|
return mav;
|
||||||
|
|
@ -149,7 +151,7 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
apprv.setUserSeq(loginUser.getUserSeq());
|
apprv.setUserSeq(loginUser.getUserSeq());
|
||||||
apprv.setUserNm(loginUser.getUserNm());
|
apprv.setUserNm(loginUser.getUserNm());
|
||||||
apprv.setSaveDt(LocalDateTime.now());
|
apprv.setSaveDt(LocalDateTime.now());
|
||||||
return monthPlanService.planStateChange(apprv);
|
return planService.planStateChange(apprv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/apprvCommitPage")
|
@GetMapping("/apprvCommitPage")
|
||||||
|
|
@ -194,8 +196,8 @@ public class FpiMgtController { // 외사경찰견문관리
|
||||||
mav.addObject("accessAuth", accessAuth);
|
mav.addObject("accessAuth", accessAuth);
|
||||||
mav.addObject("apprvAuth", apprvAuth);
|
mav.addObject("apprvAuth", apprvAuth);
|
||||||
planBoard.setQueryInfo();
|
planBoard.setQueryInfo();
|
||||||
mav.addObject("planList", monthPlanService.selectPlanBoardList(planBoard));
|
mav.addObject("planList", planService.selectPlanBoardList(planBoard));
|
||||||
planBoard.setContentCnt(monthPlanService.selectPlanBoardListCnt(planBoard));
|
planBoard.setContentCnt(planService.selectPlanBoardListCnt(planBoard));
|
||||||
planBoard.setPaginationInfo();
|
planBoard.setPaginationInfo();
|
||||||
mav.addObject("searchParams", planBoard);
|
mav.addObject("searchParams", planBoard);
|
||||||
return mav;
|
return mav;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.mapper;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairBoard;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface AffairMapper {
|
||||||
|
|
||||||
|
List<AffairBoard> selectAffairBoardList(AffairBoard affair);
|
||||||
|
|
||||||
|
Integer selectAffairBoardCnt(AffairBoard affair);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.model;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.config.BaseModel;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamicInsert
|
||||||
|
@DynamicUpdate
|
||||||
|
@Table(name = "affair_board")
|
||||||
|
public class AffairBoard extends BaseModel {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "affair_key")
|
||||||
|
private Integer affairKey;
|
||||||
|
@Column(name = "affair_status")
|
||||||
|
private String affairStatus;
|
||||||
|
@Column(name = "affair_type1")
|
||||||
|
private String affairType1;
|
||||||
|
@Column(name = "affair_type2")
|
||||||
|
private String affairType2;
|
||||||
|
@Column(name = "affair_type3")
|
||||||
|
private String affairType3;
|
||||||
|
@Column(name = "affair_type4")
|
||||||
|
private String affairType4;
|
||||||
|
@Column(name = "title")
|
||||||
|
private String title;
|
||||||
|
@Column(name = "content")
|
||||||
|
private String content;
|
||||||
|
@Column(name = "wrt_organ")
|
||||||
|
private String wrtOrgan;
|
||||||
|
@Column(name = "wrt_part")
|
||||||
|
private String wrtPart;
|
||||||
|
@Column(name = "wrt_user_nm")
|
||||||
|
private String wrtUserNm;
|
||||||
|
@Column(name = "wrt_dt")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
|
private LocalDateTime wrtDt;
|
||||||
|
@Column(name = "plan_state")
|
||||||
|
private String planState;
|
||||||
|
@Column(name = "wrt_user_seq")
|
||||||
|
private Integer wrtUserSeq;
|
||||||
|
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private List<AffairFile> fileList;
|
||||||
|
@Transient
|
||||||
|
private List<AffairRating> rateList;
|
||||||
|
@Transient
|
||||||
|
private List<MultipartFile> multipartFileList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.model;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
|
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 = "affair_file")
|
||||||
|
@IdClass(AffairFile.AffairFileId.class)
|
||||||
|
public class AffairFile extends FileInfo {
|
||||||
|
@Id
|
||||||
|
@Column(name = "affair_key")
|
||||||
|
private Integer affairKey;
|
||||||
|
@Id
|
||||||
|
@Column(name = "file_seq")
|
||||||
|
private Integer fileSeq;
|
||||||
|
@Column(name = "orig_nm")
|
||||||
|
private String origNm;
|
||||||
|
@Column(name = "conv_nm")
|
||||||
|
private String convNm;
|
||||||
|
@Column(name = "file_extn")
|
||||||
|
private String fileExtn;
|
||||||
|
@Column(name = "file_size")
|
||||||
|
private String fileSize;
|
||||||
|
@Column(name = "save_path")
|
||||||
|
private String savePath;
|
||||||
|
|
||||||
|
|
||||||
|
@Embeddable
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class AffairFileId implements Serializable {
|
||||||
|
private Integer affairKey;
|
||||||
|
private Integer fileSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.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 = "affair_rating")
|
||||||
|
@IdClass(AffairRating.AffairRatingId.class)
|
||||||
|
public class AffairRating{
|
||||||
|
@Id
|
||||||
|
@Column(name = "affair_key")
|
||||||
|
private Integer affairKey;
|
||||||
|
@Id
|
||||||
|
@Column(name = "rating_organ")
|
||||||
|
private String ratingOrgan;
|
||||||
|
@Column(name = "section_nm")
|
||||||
|
private String sectionNm;
|
||||||
|
@Column(name = "section_apprv")
|
||||||
|
private String sectionApprv;
|
||||||
|
@Column(name = "section_etc")
|
||||||
|
private String sectionEtc;
|
||||||
|
@Column(name = "head_nm")
|
||||||
|
private String headNm;
|
||||||
|
@Column(name = "head_apprv")
|
||||||
|
private String headApprv;
|
||||||
|
@Column(name = "head_etc")
|
||||||
|
private String headEtc;
|
||||||
|
@Column(name = "affair_rate")
|
||||||
|
private String affairRate;
|
||||||
|
@Column(name = "organ_up")
|
||||||
|
private String organUp;
|
||||||
|
|
||||||
|
|
||||||
|
@Embeddable
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class AffairRatingId implements Serializable {
|
||||||
|
private Integer affairKey;
|
||||||
|
private String ratingOrgan;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamicInsert
|
||||||
|
@DynamicUpdate
|
||||||
|
@Table(name = "hash_tag")
|
||||||
|
public class HashTag{
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "tag_key")
|
||||||
|
private Integer tagKey;
|
||||||
|
@Column(name = "tag_nm")
|
||||||
|
private String tagNm;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.model;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
|
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 = "hash_tag_link")
|
||||||
|
@IdClass(HashTagLink.HashTagLinkId.class)
|
||||||
|
public class HashTagLink extends FileInfo {
|
||||||
|
@Id
|
||||||
|
@Column(name = "affair_key")
|
||||||
|
private Integer affairKey;
|
||||||
|
@Id
|
||||||
|
@Column(name = "tag_key")
|
||||||
|
private Integer tagKey;
|
||||||
|
|
||||||
|
|
||||||
|
@Embeddable
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class HashTagLinkId implements Serializable {
|
||||||
|
private Integer affairKey;
|
||||||
|
private Integer tagKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairBoard;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
|
||||||
|
public interface AffairBoardRepository extends JpaRepository<AffairBoard, Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairFile;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
|
public interface AffairFileRepository extends JpaRepository<AffairFile, AffairFile.AffairFileId> {
|
||||||
|
List<AffairFile> findByAffairKey(Integer affairKey);
|
||||||
|
Optional<AffairFile> findTopByAffairKeyOrderByFileSeqDesc(Integer planKey);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairRating;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface AffairRatingRepository extends JpaRepository<AffairRating, AffairRating.AffairRatingId> {
|
||||||
|
List<AffairRating> findByAffairKey(Integer affairKey);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.HashTagLink;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
|
||||||
|
public interface HashTagLinkRepository extends JpaRepository<HashTagLink, HashTagLink.HashTagLinkId> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.HashTag;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
|
||||||
|
public interface HashTagRepository extends JpaRepository<HashTag, Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.dbnt.faisp.fpiMgt.affair.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dbnt.faisp.config.BaseService;
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.mapper.AffairMapper;
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairBoard;
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.model.AffairFile;
|
||||||
|
import com.dbnt.faisp.fpiMgt.affair.repository.*;
|
||||||
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanFile;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AffairService extends BaseService { // 견문보고
|
||||||
|
private final AffairBoardRepository affairBoardRepository;
|
||||||
|
private final AffairFileRepository affairFileRepository;
|
||||||
|
private final AffairRatingRepository affairRatingRepository;
|
||||||
|
private final HashTagRepository hashTagRepository;
|
||||||
|
private final HashTagLinkRepository hashTagLinkRepository;
|
||||||
|
private final AffairMapper affairMapper;
|
||||||
|
|
||||||
|
public List<AffairBoard> selectAffairBoardList(AffairBoard affair){
|
||||||
|
return affairMapper.selectAffairBoardList(affair);
|
||||||
|
}
|
||||||
|
public Integer selectAffairBoardCnt(AffairBoard affair){
|
||||||
|
return affairMapper.selectAffairBoardCnt(affair);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AffairBoard selectAffairBoard(Integer affairKey){
|
||||||
|
AffairBoard affair = affairBoardRepository.findById(affairKey).orElse(null);
|
||||||
|
if(affair != null){
|
||||||
|
affair.setFileList(affairFileRepository.findByAffairKey(affairKey));
|
||||||
|
affair.setRateList(affairRatingRepository.findByAffairKey(affairKey));
|
||||||
|
}
|
||||||
|
return affair;
|
||||||
|
}
|
||||||
|
@Transactional
|
||||||
|
public Integer saveAffairBoard(AffairBoard affair, List<Integer> deleteFileSeq){
|
||||||
|
Integer affairKey = affairBoardRepository.save(affair).getAffairKey();
|
||||||
|
if(deleteFileSeq != null && deleteFileSeq.size()>0){
|
||||||
|
deleteAffairFile(affairKey, deleteFileSeq);
|
||||||
|
}
|
||||||
|
if(affair.getMultipartFileList()!=null){
|
||||||
|
saveUploadFiles(affairKey, affair.getMultipartFileList());
|
||||||
|
}
|
||||||
|
return affairKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteAffairFile(Integer affairKey, List<Integer> deleteFileSeq) {
|
||||||
|
List<AffairFile> affairFileList = affairFileRepository.findByAffairKey(affairKey);
|
||||||
|
for(AffairFile file: affairFileList){
|
||||||
|
if(deleteFileSeq.contains(file.getFileSeq())){
|
||||||
|
deleteStoredFile(new File(file.getSavePath(), file.getConvNm()));
|
||||||
|
affairFileRepository.delete(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void saveUploadFiles(Integer affairKey, List<MultipartFile> multipartFileList){
|
||||||
|
AffairFile lastFileInfo = affairFileRepository.findTopByAffairKeyOrderByFileSeqDesc(affairKey).orElse(null);
|
||||||
|
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
|
||||||
|
for(MultipartFile file : multipartFileList){
|
||||||
|
String saveName = UUID.randomUUID().toString();
|
||||||
|
String path = locationPath+File.separator+"monthPlan"+File.separator;
|
||||||
|
saveFile(file, new File(path+File.separator+saveName));
|
||||||
|
|
||||||
|
String originalFilename = file.getOriginalFilename();
|
||||||
|
int extnIdx = originalFilename.lastIndexOf(".");
|
||||||
|
AffairFile fileInfo = new AffairFile();
|
||||||
|
fileInfo.setAffairKey(affairKey);
|
||||||
|
fileInfo.setFileSeq(fileSeq++);
|
||||||
|
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
|
||||||
|
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
|
||||||
|
fileInfo.setConvNm(saveName);
|
||||||
|
fileInfo.setFileSize(calculationSize(file.getSize()));
|
||||||
|
fileInfo.setSavePath(path);
|
||||||
|
affairFileRepository.save(fileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface MonthPlanMapper {
|
public interface PlanMapper {
|
||||||
|
|
||||||
List<PlanBoard> selectPlanBoardList(PlanBoard planBoard);
|
List<PlanBoard> selectPlanBoardList(PlanBoard planBoard);
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.dbnt.faisp.fpiMgt.monthPlan.service;
|
||||||
|
|
||||||
import com.dbnt.faisp.config.BaseService;
|
import com.dbnt.faisp.config.BaseService;
|
||||||
import com.dbnt.faisp.config.FileInfo;
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.mapper.MonthPlanMapper;
|
import com.dbnt.faisp.fpiMgt.monthPlan.mapper.PlanMapper;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanApprv;
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanApprv;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanBoard;
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanBoard;
|
||||||
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanFile;
|
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanFile;
|
||||||
|
|
@ -18,18 +18,25 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class MonthPlanService extends BaseService {
|
public class PlanService extends BaseService { // 월간계획
|
||||||
private final PlanBoardRepository planBoardRepository;
|
private final PlanBoardRepository planBoardRepository;
|
||||||
private final PlanFileRepository planFileRepository;
|
private final PlanFileRepository planFileRepository;
|
||||||
private final PlanMainInfoRepository planMainInfoRepository;
|
private final PlanMainInfoRepository planMainInfoRepository;
|
||||||
private final PlanApprvRepository planApprvRepository;
|
private final PlanApprvRepository planApprvRepository;
|
||||||
private final MonthPlanMapper monthPlanMapper;
|
private final PlanMapper planMapper;
|
||||||
|
|
||||||
|
public List<PlanBoard> selectPlanBoardList(PlanBoard planBoard) {
|
||||||
|
return planMapper.selectPlanBoardList(planBoard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer selectPlanBoardListCnt(PlanBoard planBoard) {
|
||||||
|
return planMapper.selectPlanBoardListCnt(planBoard);
|
||||||
|
}
|
||||||
|
|
||||||
public PlanBoard selectPlanBoard(Integer planKey) {
|
public PlanBoard selectPlanBoard(Integer planKey) {
|
||||||
PlanBoard savedPlan = planBoardRepository.findById(planKey).orElse(null);
|
PlanBoard savedPlan = planBoardRepository.findById(planKey).orElse(null);
|
||||||
|
|
@ -67,14 +74,6 @@ public class MonthPlanService extends BaseService {
|
||||||
return planSeq;
|
return planSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PlanBoard> selectPlanBoardList(PlanBoard planBoard) {
|
|
||||||
return monthPlanMapper.selectPlanBoardList(planBoard);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer selectPlanBoardListCnt(PlanBoard planBoard) {
|
|
||||||
return monthPlanMapper.selectPlanBoardListCnt(planBoard);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveUploadFiles(Integer planKey, List<MultipartFile> multipartFileList){
|
private void saveUploadFiles(Integer planKey, List<MultipartFile> multipartFileList){
|
||||||
PlanFile lastFileInfo = planFileRepository.findTopByPlanKeyOrderByFileSeqDesc(planKey).orElse(null);
|
PlanFile lastFileInfo = planFileRepository.findTopByPlanKeyOrderByFileSeqDesc(planKey).orElse(null);
|
||||||
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
|
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
|
||||||
|
|
@ -97,7 +96,7 @@ public class MonthPlanService extends BaseService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deletePlanFile(Integer planKey, List<Integer> deleteFileSeq) {
|
private void deletePlanFile(Integer planKey, List<Integer> deleteFileSeq) {
|
||||||
List<PlanFile> planFileList = planFileRepository.findByPlanKey(planKey);
|
List<PlanFile> planFileList = planFileRepository.findByPlanKey(planKey);
|
||||||
for(PlanFile file: planFileList){
|
for(PlanFile file: planFileList){
|
||||||
if(deleteFileSeq.contains(file.getFileSeq())){
|
if(deleteFileSeq.contains(file.getFileSeq())){
|
||||||
|
|
@ -107,8 +106,8 @@ public class MonthPlanService extends BaseService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileInfo selectPlanFile(Integer parentKey, Integer fileSeq) {
|
public FileInfo selectPlanFile(Integer planKey, Integer fileSeq) {
|
||||||
return planFileRepository.findById(new PlanFile.PlanFileId(parentKey, fileSeq)).orElse(null);
|
return planFileRepository.findById(new PlanFile.PlanFileId(planKey, fileSeq)).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dbnt.faisp.publicBoard.service;
|
package com.dbnt.faisp.publicBoard.service;
|
||||||
|
|
||||||
import com.dbnt.faisp.config.BaseService;
|
import com.dbnt.faisp.config.BaseService;
|
||||||
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
import com.dbnt.faisp.publicBoard.mapper.PublicBoardMapper;
|
import com.dbnt.faisp.publicBoard.mapper.PublicBoardMapper;
|
||||||
import com.dbnt.faisp.publicBoard.model.PublicBoard;
|
import com.dbnt.faisp.publicBoard.model.PublicBoard;
|
||||||
import com.dbnt.faisp.publicBoard.model.PublicComment;
|
import com.dbnt.faisp.publicBoard.model.PublicComment;
|
||||||
|
|
@ -102,4 +103,8 @@ public class PublicBoardService extends BaseService {
|
||||||
publicCommentRepository.deleteAll(childList);
|
publicCommentRepository.deleteAll(childList);
|
||||||
publicCommentRepository.deleteById(new PublicComment.PublicCommentId(publicKey, commentKey));
|
publicCommentRepository.deleteById(new PublicComment.PublicCommentId(publicKey, commentKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FileInfo selectPublicFile(Integer publicKey, Integer fileSeq){
|
||||||
|
return publicFileRepository.findById(new PublicFile.PublicFileId(publicKey, fileSeq)).orElse(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?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="com.dbnt.faisp.fpiMgt.affair.mapper.AffairMapper">
|
||||||
|
<sql id="selectAffairBoardListWhere">
|
||||||
|
<where>
|
||||||
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||||
|
and a.wrt_user_seq = #{wrtUserSeq}
|
||||||
|
</if>
|
||||||
|
<if test='wrtUserNm != null and wrtUserNm != ""'>
|
||||||
|
and a.wrt_user_nm like '%'||#{wrtUserNm}||'%'
|
||||||
|
</if>
|
||||||
|
<if test='wrtOrgan != null and wrtOrgan != ""'>
|
||||||
|
and a.wrt_organ = #{wrtOrgan}
|
||||||
|
</if>
|
||||||
|
<if test='contentTitle != null and contentTitle != ""'>
|
||||||
|
and a.content_title like '%'||#{contentTitle}||'%'
|
||||||
|
</if>
|
||||||
|
<if test='affairState != null and affairState != ""'>
|
||||||
|
and a.affair_state = #{affairState}
|
||||||
|
</if>
|
||||||
|
<if test='dateSelector == "wrtDt"'>
|
||||||
|
<if test='startDate != null and startDate != ""'>
|
||||||
|
and a.wrt_dt >= #{startDate}::date
|
||||||
|
</if>
|
||||||
|
<if test='endDate != null and endDate != ""'>
|
||||||
|
and a.wrt_dt <= #{endDate}::date
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
<if test="downOrganCdList != null">
|
||||||
|
and a.wrt_organ in
|
||||||
|
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
|
||||||
|
#{organCd}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<select id="selectAffairBoardList" resultType="AffairBoard" parameterType="AffairBoard">
|
||||||
|
select a.affair_key,
|
||||||
|
a.title,
|
||||||
|
a.affair_state,
|
||||||
|
a.wrt_organ,
|
||||||
|
a.wrt_part,
|
||||||
|
a.wrt_user_nm,
|
||||||
|
a.wrt_user_seq,
|
||||||
|
a.wrt_dt,
|
||||||
|
b.fileCnt
|
||||||
|
from affair_board a
|
||||||
|
left outer join (select affair_key,
|
||||||
|
count(file_seq) as fileCnt
|
||||||
|
from affair_file
|
||||||
|
group by affair_key) b
|
||||||
|
on a.affair_key = b.affair_key
|
||||||
|
<include refid="selectAffairBoardListWhere"></include>
|
||||||
|
order by affair_key desc
|
||||||
|
limit #{rowCnt} offset #{firstIndex}
|
||||||
|
</select>
|
||||||
|
<select id="selectAffairBoardListCnt" resultType="int" parameterType="AffairBoard">
|
||||||
|
select count(*)
|
||||||
|
from affair_board a
|
||||||
|
<include refid="selectAffairBoardListWhere"></include>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.dbnt.faisp.fpiMgt.monthPlan.mapper.MonthPlanMapper">
|
<mapper namespace="com.dbnt.faisp.fpiMgt.monthPlan.mapper.PlanMapper">
|
||||||
<sql id="selectPlanBoardListWhere">
|
<sql id="selectPlanBoardListWhere">
|
||||||
<where>
|
<where>
|
||||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||||
Loading…
Reference in New Issue