mirror of
https://git.hmsn.ink/kospo/svcm/api.git
synced 2026-03-19 19:35:09 +09:00
전표 생성 수정 (결재선만 변경)
This commit is contained in:
@@ -3,7 +3,7 @@ sabun: 17131303
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"wkfid": "FI2025900010",
|
||||
"wkfid": "FI2025900017",
|
||||
"wkfsq": 2,
|
||||
"bname": "17131303",
|
||||
"wkfst": "A"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
POST http://localhost:8010/api/sap/appr
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"belnr": "202500102045",
|
||||
"wkftx": "결재 테스트 11",
|
||||
"apprs": [
|
||||
{
|
||||
"label": "결재",
|
||||
"value": [
|
||||
{
|
||||
"lineclsf": "Q",
|
||||
"bname": "15000037",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "I",
|
||||
"bname": "15000003",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "I",
|
||||
"bname": "15000004",
|
||||
"abscd": "A"
|
||||
},
|
||||
{
|
||||
"lineclsf": "E",
|
||||
"bname": "15000037",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "E",
|
||||
"bname": "15000062",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "A",
|
||||
"bname": "15000005",
|
||||
"abscd": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@ sabun: 15000062
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"wkfid": "FI2025900010",
|
||||
"wkfid": "FI2025900017",
|
||||
"apprs": [
|
||||
{
|
||||
"label": "협조",
|
||||
|
||||
47
api/slip/임시전표수정(결재만 수정가능 그외 삭제).http
Normal file
47
api/slip/임시전표수정(결재만 수정가능 그외 삭제).http
Normal file
@@ -0,0 +1,47 @@
|
||||
PUT http://localhost:8010/api/slip
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"contNo": "CONT-20250527037",
|
||||
"zwf0011t": {
|
||||
"belnr": "0604103229",
|
||||
"wkfid": "FI2025900014",
|
||||
"apprs": [
|
||||
{
|
||||
"label": "결재",
|
||||
"value": [
|
||||
{
|
||||
"lineclsf": "Q",
|
||||
"bname": "psn14020",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "I",
|
||||
"bname": "17131303",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "I",
|
||||
"bname": "15000004",
|
||||
"abscd": "A"
|
||||
},
|
||||
{
|
||||
"lineclsf": "E",
|
||||
"bname": "15000037",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "E",
|
||||
"bname": "15000062",
|
||||
"abscd": ""
|
||||
},
|
||||
{
|
||||
"lineclsf": "A",
|
||||
"bname": "15000005",
|
||||
"abscd": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,11 @@ package com.kospo.svcm.controller;
|
||||
|
||||
import com.kospo.svcm.config.exception.CustomErrorResponse;
|
||||
import com.kospo.svcm.dto.req.Zwf0011tSaveRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprUpdateRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprApprovalRequest;
|
||||
import com.kospo.svcm.dto.res.PageResponse;
|
||||
import com.kospo.svcm.dto.res.Zwf0011tResponse;
|
||||
import com.kospo.svcm.service.ApprService;
|
||||
import com.kospo.svcm.service.SapService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -16,13 +14,9 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.security.Principal;
|
||||
|
||||
@Tag(name = "Sap Approval Api", description = "Sap 결재 관리")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@@ -137,9 +131,9 @@ public class SapApprController {
|
||||
})
|
||||
@PutMapping("/sap/appr")
|
||||
public ResponseEntity approve(
|
||||
@RequestBody ZwfApprUpdateRequest zwfApprUpdateRequest
|
||||
@RequestBody ZwfApprApprovalRequest zwfApprApprovalRequest
|
||||
) {
|
||||
return ResponseEntity.ok(sapService.approve(zwfApprUpdateRequest));
|
||||
return ResponseEntity.ok(sapService.approve(zwfApprApprovalRequest));
|
||||
}
|
||||
// @Operation(summary = "본인 결재목록 조회", description = "가격조사 결재 조회")
|
||||
// @ApiResponses({
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.kospo.svcm.controller;
|
||||
import com.kospo.svcm.config.exception.CustomErrorResponse;
|
||||
import com.kospo.svcm.config.utils.FileUtils;
|
||||
import com.kospo.svcm.dto.req.SlipSaveRequest;
|
||||
import com.kospo.svcm.dto.req.SlipUpdateRequest;
|
||||
import com.kospo.svcm.dto.res.EstimateListResponse;
|
||||
import com.kospo.svcm.service.EstimateService;
|
||||
import com.kospo.svcm.service.PrcsService;
|
||||
@@ -80,10 +81,10 @@ public class SlipController {
|
||||
@Operation(summary = "임시전표 저장", description = "임시전표 (계약중 대상자) 저장")
|
||||
@ApiResponses({
|
||||
@ApiResponse(description = "Success", responseCode = "200",
|
||||
content = @Content(mediaType = "application/json", array = @ArraySchema(
|
||||
content = @Content(mediaType = "application/json",
|
||||
schema = @Schema(oneOf =
|
||||
{EstimateListResponse.class})
|
||||
))),
|
||||
)),
|
||||
@ApiResponse(description = "Not found", responseCode = "404",
|
||||
content = @Content(mediaType = "text/plain", schema = @Schema(oneOf =
|
||||
{String.class}))),
|
||||
@@ -98,6 +99,27 @@ public class SlipController {
|
||||
return ResponseEntity.ok(slipService.save(slipSaveRequest));
|
||||
}
|
||||
|
||||
@Operation(summary = "임시전표 수정", description = "임시전표 (결재선만 수정가능 그외 회수 처리) 저장")
|
||||
@ApiResponses({
|
||||
@ApiResponse(description = "Success", responseCode = "200",
|
||||
content = @Content(mediaType = "application/json",
|
||||
schema = @Schema(oneOf =
|
||||
{EstimateListResponse.class})
|
||||
)),
|
||||
@ApiResponse(description = "Not found", responseCode = "404",
|
||||
content = @Content(mediaType = "text/plain", schema = @Schema(oneOf =
|
||||
{String.class}))),
|
||||
@ApiResponse(description = "Internal Error", responseCode = "500",
|
||||
content = @Content(mediaType = "application/json", schema = @Schema(oneOf =
|
||||
{CustomErrorResponse.class})))
|
||||
})
|
||||
@PutMapping("/slip")
|
||||
public ResponseEntity update(
|
||||
@RequestBody SlipUpdateRequest slipUpdateRequest
|
||||
) {
|
||||
return ResponseEntity.ok(slipService.update(slipUpdateRequest));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "임시전표삭제 삭제", description = "임시전표삭제 삭제")
|
||||
@ApiResponses({
|
||||
|
||||
21
src/main/java/com/kospo/svcm/dto/req/SlipUpdateRequest.java
Normal file
21
src/main/java/com/kospo/svcm/dto/req/SlipUpdateRequest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.kospo.svcm.dto.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(name = "SlipUpdateRequest", description = "임시전표 생성")
|
||||
public class SlipUpdateRequest implements Serializable {
|
||||
@Schema(name = "contNo", description = "계약번호")
|
||||
String contNo;
|
||||
Zwf0011tUpdateRequest zwf0011t;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.kospo.svcm.dto.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.kospo.svcm.model.Zwf0011t;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DTO for {@link Zwf0011t}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(name = "Zwf0011tUpdateRequest", description = "SAP 결재 마스터(수정)")
|
||||
public class Zwf0011tUpdateRequest implements Serializable {
|
||||
@Schema(name = "belnr", description = "전표번호")
|
||||
String belnr;
|
||||
@Schema(name = "wkfid", description = "요청번호")
|
||||
String wkfid;
|
||||
|
||||
List<ZwfApprGrpUpdateRequest> apprs;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.kospo.svcm.dto.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.kospo.svcm.model.Zwf0012t;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* DTO for {@link Zwf0012t}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(name = "ZwfApprUpdateRequest", description = "SAP 결재 승인")
|
||||
public class ZwfApprApprovalRequest implements Serializable {
|
||||
@Schema(name = "wkfid", description = "요청번호")
|
||||
String wkfid;
|
||||
@Schema(name = "wkfsq", description = "결재순번")
|
||||
Integer wkfsq;
|
||||
@Schema(name = "bname", description = "사번")
|
||||
String bname;
|
||||
@Schema(name = "wkfst", description = "결재상태")
|
||||
String wkfst;
|
||||
@Schema(name = "reason", description = "(반려)사유")
|
||||
String reason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.kospo.svcm.dto.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.kospo.svcm.model.Zwf0011t;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DTO for {@link Zwf0011t}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(name = "ZwfApprGrpUpdateRequest", description = "SAP 그룹")
|
||||
public class ZwfApprGrpUpdateRequest implements Serializable {
|
||||
@Schema(name = "label", description = "명칭")
|
||||
String label;
|
||||
@Schema(name = "value", description = "결재선")
|
||||
List<ZwfApprSaveRequest> value;
|
||||
|
||||
}
|
||||
@@ -22,8 +22,6 @@ public class ZwfApprSaveRequest implements Serializable {
|
||||
String lineclsf;
|
||||
@Schema(name = "bname", description = "사번")
|
||||
String bname;
|
||||
@Schema(name = "gubun", description = "결재선 구분")
|
||||
String gubun;
|
||||
@Schema(name = "abscd", description = "사유코드(근태)")
|
||||
String abscd;
|
||||
@Schema(name = "grpid", description = "그룹번호")
|
||||
|
||||
@@ -16,17 +16,15 @@ import java.io.Serializable;
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(name = "ZwfApprUpdateRequest", description = "SAP 결재 승인")
|
||||
@Schema(name = "ZwfApprSaveRequest", description = "SAP 결재선")
|
||||
public class ZwfApprUpdateRequest implements Serializable {
|
||||
@Schema(name = "wkfid", description = "요청번호")
|
||||
String wkfid;
|
||||
@Schema(name = "wkfsq", description = "결재순번")
|
||||
Integer wkfsq;
|
||||
@Schema(name = "lineclsf", description = "결재구분")
|
||||
String lineclsf;
|
||||
@Schema(name = "bname", description = "사번")
|
||||
String bname;
|
||||
@Schema(name = "wkfst", description = "결재상태")
|
||||
String wkfst;
|
||||
@Schema(name = "reason", description = "(반려)사유")
|
||||
String reason;
|
||||
@Schema(name = "abscd", description = "사유코드(근태)")
|
||||
String abscd;
|
||||
@Schema(name = "grpid", description = "그룹번호")
|
||||
Integer grpid;
|
||||
|
||||
}
|
||||
@@ -145,4 +145,6 @@ public interface Zwf0012tRepository extends JpaRepository<Zwf0012t, Zwf0012tId>
|
||||
"WHERE wkfid = :wkfid and num = 1\n" +
|
||||
") cc inner join zwf0011t z11 on cc.wkfid = z11.wkfid", nativeQuery = true)
|
||||
List<SapApprReqDto> nextTarget(@Param("wkfid") String wkfid);
|
||||
|
||||
void deleteByIdWkfid(String wkfid);
|
||||
}
|
||||
@@ -10,4 +10,6 @@ public interface Zwf0013tRepository extends JpaRepository<Zwf0013t, Zwf0013tId>
|
||||
List<Zwf0013t> findByIdWkfidOrderByLineclsfDesc(String WkfId);
|
||||
|
||||
Zwf0013t findByWkfsqAndIdWkfidAndIdBname(Integer wkfsq, String idWkfid, String idBname);
|
||||
|
||||
void deleteByIdWkfid(String wkfid);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.kospo.svcm.service;
|
||||
|
||||
import com.kospo.svcm.dto.req.Zwf0011tSaveRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprUpdateRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprApprovalRequest;
|
||||
import com.kospo.svcm.dto.res.PageResponse;
|
||||
import com.kospo.svcm.dto.res.Zwf0011tResponse;
|
||||
import com.kospo.svcm.dto.res.ZwfApprResponse;
|
||||
@@ -22,5 +22,5 @@ public interface SapService {
|
||||
@Transactional
|
||||
Zwf0011tResponse save(Zwf0011tSaveRequest zwf0011tSaveRequest);
|
||||
|
||||
List<ZwfApprResponse> approve(ZwfApprUpdateRequest zwfApprUpdateRequest);
|
||||
List<ZwfApprResponse> approve(ZwfApprApprovalRequest zwfApprApprovalRequest);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kospo.svcm.service;
|
||||
|
||||
import com.kospo.svcm.dto.req.SlipSaveRequest;
|
||||
import com.kospo.svcm.dto.req.SlipUpdateRequest;
|
||||
import com.kospo.svcm.dto.res.SlipResponse;
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
@@ -14,6 +15,9 @@ public interface SlipService {
|
||||
@Transactional
|
||||
SlipResponse save(SlipSaveRequest slipSaveRequest);
|
||||
|
||||
@Transactional
|
||||
SlipResponse update(SlipUpdateRequest slipUpdateRequest);
|
||||
|
||||
@Transactional
|
||||
void delete(String contNo);
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@ import com.kospo.svcm.config.exception.ErrorCode;
|
||||
import com.kospo.svcm.config.utils.CommonUtils;
|
||||
import com.kospo.svcm.config.utils.SequenceUtils;
|
||||
import com.kospo.svcm.dto.req.Zwf0011tSaveRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprUpdateRequest;
|
||||
import com.kospo.svcm.dto.req.ZwfApprApprovalRequest;
|
||||
import com.kospo.svcm.dto.res.*;
|
||||
import com.kospo.svcm.exception.CustomException;
|
||||
import com.kospo.svcm.exception.CustomMessageException;
|
||||
import com.kospo.svcm.model.*;
|
||||
import com.kospo.svcm.repository.*;
|
||||
import com.kospo.svcm.service.SapService;
|
||||
@@ -247,7 +246,7 @@ public class SapServiceImpl implements SapService {
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public List<ZwfApprResponse> approve(ZwfApprUpdateRequest zwfApprUpdateRequest) {
|
||||
public List<ZwfApprResponse> approve(ZwfApprApprovalRequest zwfApprApprovalRequest) {
|
||||
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
List<ZwfApprResponse> zwfApprResponseList = new ArrayList<>();
|
||||
// if (!zwfApprUpdateRequest.getBname().equals(user.getSabun())) throw new CustomException(ErrorCode.AUTHENTICATION_NOT_SUPPORT);
|
||||
@@ -255,13 +254,13 @@ public class SapServiceImpl implements SapService {
|
||||
String aedat = CommonUtils.dateFormat("yyyyMMdd");
|
||||
String aezet = CommonUtils.dateFormat("HHmmss");
|
||||
ZwfApprResponse result = null;
|
||||
Zwf0012t zwf0012t = zwf0012tRepository.findByIdWkfidAndIdWkfsqAndBname(zwfApprUpdateRequest.getWkfid(), zwfApprUpdateRequest.getWkfsq(), zwfApprUpdateRequest.getBname());
|
||||
Zwf0012t zwf0012t = zwf0012tRepository.findByIdWkfidAndIdWkfsqAndBname(zwfApprApprovalRequest.getWkfid(), zwfApprApprovalRequest.getWkfsq(), zwfApprApprovalRequest.getBname());
|
||||
if (zwf0012t != null) {
|
||||
// if(!zwf0012t.getWkfst().equals("I")) throw new CustomMessageException(CustomMessageException.CusMessage.builder()
|
||||
// .code("999999")
|
||||
// .message("결재 대기 상태가 아닙니댜.")
|
||||
// .build());
|
||||
zwf0012t.setWkfst(zwfApprUpdateRequest.getWkfst());
|
||||
zwf0012t.setWkfst(zwfApprApprovalRequest.getWkfst());
|
||||
zwf0012t.setAenam(user.getSabun());
|
||||
zwf0012t.setAedat(aedat);
|
||||
zwf0012t.setAezet(aezet);
|
||||
@@ -269,13 +268,13 @@ public class SapServiceImpl implements SapService {
|
||||
}
|
||||
|
||||
|
||||
Zwf0013t zwf0013t = zwf0013tRepository.findByWkfsqAndIdWkfidAndIdBname(zwfApprUpdateRequest.getWkfsq(), zwfApprUpdateRequest.getWkfid(), zwfApprUpdateRequest.getBname());
|
||||
Zwf0013t zwf0013t = zwf0013tRepository.findByWkfsqAndIdWkfidAndIdBname(zwfApprApprovalRequest.getWkfsq(), zwfApprApprovalRequest.getWkfid(), zwfApprApprovalRequest.getBname());
|
||||
if (zwf0013t != null) {
|
||||
// if(!zwf0013t.getWkfst().equals("I")) throw new CustomMessageException(CustomMessageException.CusMessage.builder()
|
||||
// .code("999999")
|
||||
// .message("결재 대기 상태가 아닙니댜.")
|
||||
// .build());
|
||||
zwf0013t.setWkfst(zwfApprUpdateRequest.getWkfst());
|
||||
zwf0013t.setWkfst(zwfApprApprovalRequest.getWkfst());
|
||||
zwf0013t.setAenam(user.getSabun());
|
||||
zwf0013t.setAedat(aedat);
|
||||
zwf0013t.setAezet(aezet);
|
||||
@@ -289,16 +288,16 @@ public class SapServiceImpl implements SapService {
|
||||
|
||||
zwfApprResponseList.add(result);
|
||||
/* 대결 처리 시작 */
|
||||
if(StringUtil.isNotBlank(zwfApprUpdateRequest.getWkfst())) {
|
||||
List<Zwf0012tRepository.SapApprReqDto> apprNextTargetDtos = zwf0012tRepository.nextTarget(zwfApprUpdateRequest.getWkfid());
|
||||
if(StringUtil.isNotBlank(zwfApprApprovalRequest.getWkfst())) {
|
||||
List<Zwf0012tRepository.SapApprReqDto> apprNextTargetDtos = zwf0012tRepository.nextTarget(zwfApprApprovalRequest.getWkfid());
|
||||
// Zwf0012tRepository.ApprNextTargetDto apprNextTargetDto = zwf0012tRepository.nextTarget(zwfApprUpdateRequest.getWkfid());
|
||||
apprNextTargetDtos.stream().forEach((apprNextTargetDto) -> {
|
||||
System.out.println(apprNextTargetDto.getBtext() + "///" + apprNextTargetDto.getBname());
|
||||
if(apprNextTargetDto != null) {
|
||||
Zwf0012t nextZwf0012t = zwf0012tRepository.findByIdWkfidAndIdWkfsqAndBname(zwfApprUpdateRequest.getWkfid(), apprNextTargetDto.getWkfsq(), apprNextTargetDto.getBname());
|
||||
Zwf0012t nextZwf0012t = zwf0012tRepository.findByIdWkfidAndIdWkfsqAndBname(zwfApprApprovalRequest.getWkfid(), apprNextTargetDto.getWkfsq(), apprNextTargetDto.getBname());
|
||||
if (nextZwf0012t != null) {
|
||||
if(StringUtil.isNotBlank(nextZwf0012t.getAbscd())) {
|
||||
nextZwf0012t.setWkfst(zwfApprUpdateRequest.getWkfst());
|
||||
nextZwf0012t.setWkfst(zwfApprApprovalRequest.getWkfst());
|
||||
nextZwf0012t.setAenam(user.getSabun());
|
||||
nextZwf0012t.setAedat(aedat);
|
||||
nextZwf0012t.setAezet(aezet);
|
||||
@@ -310,10 +309,10 @@ public class SapServiceImpl implements SapService {
|
||||
}
|
||||
|
||||
|
||||
Zwf0013t nextZwf0013t = zwf0013tRepository.findByWkfsqAndIdWkfidAndIdBname(apprNextTargetDto.getWkfsq(), zwfApprUpdateRequest.getWkfid(), apprNextTargetDto.getBname());
|
||||
Zwf0013t nextZwf0013t = zwf0013tRepository.findByWkfsqAndIdWkfidAndIdBname(apprNextTargetDto.getWkfsq(), zwfApprApprovalRequest.getWkfid(), apprNextTargetDto.getBname());
|
||||
if (nextZwf0013t != null) {
|
||||
if(StringUtil.isNotBlank(nextZwf0013t.getAbscd())) {
|
||||
nextZwf0013t.setWkfst(zwfApprUpdateRequest.getWkfst());
|
||||
nextZwf0013t.setWkfst(zwfApprApprovalRequest.getWkfst());
|
||||
nextZwf0013t.setAenam(user.getSabun());
|
||||
nextZwf0013t.setAedat(aedat);
|
||||
nextZwf0013t.setAezet(aezet);
|
||||
@@ -327,13 +326,13 @@ public class SapServiceImpl implements SapService {
|
||||
}
|
||||
|
||||
|
||||
List<Zwf0012t> zwf0012ts = zwf0012tRepository.findByIdWkfidOrderByLineclsfDesc(zwfApprUpdateRequest.getWkfid());
|
||||
List<Zwf0013t> zwf0013ts = zwf0013tRepository.findByIdWkfidOrderByLineclsfDesc(zwfApprUpdateRequest.getWkfid());
|
||||
List<Zwf0012t> zwf0012ts = zwf0012tRepository.findByIdWkfidOrderByLineclsfDesc(zwfApprApprovalRequest.getWkfid());
|
||||
List<Zwf0013t> zwf0013ts = zwf0013tRepository.findByIdWkfidOrderByLineclsfDesc(zwfApprApprovalRequest.getWkfid());
|
||||
|
||||
List<Zwf0012t> zwf0012tsChecker = zwf0012ts.stream().filter(z -> z.getWkfst().equals("Q") || z.getWkfst().equals("A") || z.getWkfst().equals("N")).toList();
|
||||
List<Zwf0013t> zwf0013tsChecker = zwf0013ts.stream().filter(z -> z.getWkfst().equals("Q") || z.getWkfst().equals("A") || z.getWkfst().equals("N")).toList();
|
||||
|
||||
Zwf0011t zwf0011t = zwf0011tRepository.findByIdWkfid(zwfApprUpdateRequest.getWkfid());
|
||||
Zwf0011t zwf0011t = zwf0011tRepository.findByIdWkfid(zwfApprApprovalRequest.getWkfid());
|
||||
String belnr = zwf0011t.getObkey().substring(0, 10);
|
||||
Slip slip = slipRepository.findByBelnr(belnr);
|
||||
if(slip == null) throw new CustomException(ErrorCode.FIND_ERR);
|
||||
@@ -346,9 +345,9 @@ public class SapServiceImpl implements SapService {
|
||||
zwf0011t.setWkfst("S");
|
||||
}
|
||||
/*반려 처리*/
|
||||
else if(zwfApprUpdateRequest.getWkfst().equals("R")) {
|
||||
zwf0011t.setWkfst(zwfApprUpdateRequest.getWkfst());
|
||||
zwf0011t.setReason(zwfApprUpdateRequest.getReason());
|
||||
else if(zwfApprApprovalRequest.getWkfst().equals("R")) {
|
||||
zwf0011t.setWkfst(zwfApprApprovalRequest.getWkfst());
|
||||
zwf0011t.setReason(zwfApprApprovalRequest.getReason());
|
||||
/* 임시 전표 삭제 시작 */
|
||||
|
||||
/* 임시 전표 삭제 종료 */
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.kospo.svcm.config.utils.CommonUtils;
|
||||
import com.kospo.svcm.config.utils.FileUtils;
|
||||
import com.kospo.svcm.config.utils.SequenceUtils;
|
||||
import com.kospo.svcm.dto.req.SlipSaveRequest;
|
||||
import com.kospo.svcm.dto.req.SlipUpdateRequest;
|
||||
import com.kospo.svcm.dto.req.Zwf0011tSaveRequest;
|
||||
import com.kospo.svcm.dto.req.Zwf0011tUpdateRequest;
|
||||
import com.kospo.svcm.dto.res.SlipResponse;
|
||||
import com.kospo.svcm.dto.res.Zwf0011tResponse;
|
||||
import com.kospo.svcm.dto.res.ZwfApprGrpResponse;
|
||||
@@ -210,7 +212,6 @@ public class SlipServiceImpl implements SlipService {
|
||||
AtomicInteger sq = new AtomicInteger(1);
|
||||
zwf0011tSaveRequest.getApprs().stream().forEach(z -> {
|
||||
label.set(z.getLabel());
|
||||
if (z.getLabel().equals("결재")) {
|
||||
AtomicInteger eSq = new AtomicInteger(1);
|
||||
z.getValue().stream().forEach(zwfAppr -> {
|
||||
Optional<User> userOptional = userRepository.findById(zwfAppr.getBname());
|
||||
@@ -255,60 +256,6 @@ public class SlipServiceImpl implements SlipService {
|
||||
.build()));
|
||||
}
|
||||
});
|
||||
} else if(z.getLabel().equals("협조")) {
|
||||
wkfid.set(zwf0011tSaveRequest.getWkfid());
|
||||
AtomicInteger eSq = new AtomicInteger(1);
|
||||
|
||||
z.getValue().stream().forEach(zwfAppr -> {
|
||||
Optional<User> userOptional = userRepository.findById(zwfAppr.getBname());
|
||||
if (userOptional.isEmpty()) throw new CustomException(ErrorCode.AUTHENTICATION_NOT_SUPPORT);
|
||||
if(zwfAppr.getLineclsf().equals("Q")) {
|
||||
/* 협조 결재자 -> 신규 결재 입안자로 변경 */
|
||||
Optional<Zwf0013t> zwf0013tOptional = zwf0013tRepository.findById(Zwf0013tId.builder()
|
||||
.wkfid(wkfid.get())
|
||||
.gubun("I")
|
||||
.bname(userOptional.get().getSabun())
|
||||
.build());
|
||||
|
||||
if(zwf0013tOptional.isEmpty()) throw new CustomException(ErrorCode.AUTHENTICATION_NOT_SUPPORT);
|
||||
|
||||
Zwf0013t zwf0013t = zwf0013tOptional.get();
|
||||
zwf0013t.setLineclsf(zwfAppr.getLineclsf());
|
||||
|
||||
zwf0013t.setErnam(ernam);
|
||||
zwf0013t.setErdat(erdat);
|
||||
zwf0013t.setErzet(erzet);
|
||||
|
||||
zwf0013t.setAenam(ernam);
|
||||
zwf0013t.setAedat(erdat);
|
||||
zwf0013t.setAezet(erzet);
|
||||
|
||||
zwf0013t.setWkfst("A");
|
||||
zwf0013t.setWkfsq(eSq.getAndIncrement());
|
||||
mergeList.add(zwf0013tRepository.save(zwf0013t));
|
||||
} else {
|
||||
mergeList.add(zwf0013tRepository.save(Zwf0013t.builder()
|
||||
.id(Zwf0013tId.builder()
|
||||
.wkfid(wkfid.get())
|
||||
.gubun("I")
|
||||
.bname(userOptional.get().getSabun())
|
||||
.build())
|
||||
.lineclsf(zwfAppr.getLineclsf())
|
||||
.abscd(zwfAppr.getAbscd())
|
||||
.btext(userOptional.get().getName())
|
||||
.posit(userOptional.get().getGradeNm())
|
||||
.deptn(userOptional.get().getDept().getDeptNm())
|
||||
.wkfst(zwfAppr.getLineclsf().equals("Q") ? "A" : "I")
|
||||
.wkfsq(eSq.getAndIncrement())
|
||||
.ernam(ernam)
|
||||
.erdat(erdat)
|
||||
.erzet(erzet)
|
||||
.wkfsq1(0)
|
||||
.grpid(zwfAppr.getGrpid())
|
||||
.build()));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
zwf0011tResponse.get().setApprs(Arrays.asList(ZwfApprGrpResponse.builder()
|
||||
@@ -323,6 +270,94 @@ public class SlipServiceImpl implements SlipService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public SlipResponse update(SlipUpdateRequest slipUpdateRequest) {
|
||||
|
||||
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
|
||||
/* eai fi 전송 성공후 저장*/
|
||||
/*계약진행중인 대상자*/
|
||||
Cont cont = contRepository.findByContNoAndContStatCd(slipUpdateRequest.getContNo(), "0300");
|
||||
if(cont == null) throw new CustomException(ErrorCode.SAVE_ERR);
|
||||
|
||||
Slip slip = slipRepository.findByContNo(slipUpdateRequest.getContNo());
|
||||
|
||||
AtomicReference<Zwf0011tResponse> zwf0011tResponse = new AtomicReference<>();
|
||||
|
||||
Zwf0011tUpdateRequest zwf0011tUpdateRequest = slipUpdateRequest.getZwf0011t();
|
||||
String wkfid = slipUpdateRequest.getZwf0011t().getWkfid();
|
||||
String ernam = user.getSabun();
|
||||
String erdat = CommonUtils.dateFormat("yyyyMMdd");
|
||||
String erzet = CommonUtils.dateFormat("HHmmss");
|
||||
AtomicReference<String> label = new AtomicReference<>("");
|
||||
|
||||
zwf0011tResponse.set(Zwf0011tResponse.to(zwf0011tRepository.findByIdWkfid(zwf0011tUpdateRequest.getWkfid())));
|
||||
|
||||
zwf0012tRepository.deleteByIdWkfid(zwf0011tUpdateRequest.getWkfid());
|
||||
zwf0013tRepository.deleteByIdWkfid(zwf0011tUpdateRequest.getWkfid());
|
||||
|
||||
List<Object> mergeList = new ArrayList<>();
|
||||
AtomicInteger sq = new AtomicInteger(1);
|
||||
zwf0011tUpdateRequest.getApprs().stream().forEach(z -> {
|
||||
label.set(z.getLabel());
|
||||
AtomicInteger eSq = new AtomicInteger(1);
|
||||
z.getValue().stream().forEach(zwfAppr -> {
|
||||
Optional<User> userOptional = userRepository.findById(zwfAppr.getBname());
|
||||
if (userOptional.isEmpty()) throw new CustomException(ErrorCode.AUTHENTICATION_NOT_SUPPORT);
|
||||
|
||||
if (zwfAppr.getLineclsf().equals("E")) {
|
||||
mergeList.add(zwf0013tRepository.save(Zwf0013t.builder()
|
||||
.id(Zwf0013tId.builder()
|
||||
.wkfid(wkfid)
|
||||
.gubun("I")
|
||||
.bname(userOptional.get().getSabun())
|
||||
.build())
|
||||
.lineclsf(zwfAppr.getLineclsf())
|
||||
.abscd(zwfAppr.getAbscd())
|
||||
.btext(userOptional.get().getName())
|
||||
.posit(userOptional.get().getGradeNm())
|
||||
.deptn(userOptional.get().getDept().getDeptNm())
|
||||
.wkfst(zwfAppr.getLineclsf().equals("Q") ? "Q" : "I")
|
||||
.wkfsq(eSq.get())
|
||||
.ernam(ernam)
|
||||
.erdat(erdat)
|
||||
.erzet(erzet)
|
||||
.wkfsq1(2)
|
||||
.grpid(eSq.getAndIncrement())
|
||||
.build()));
|
||||
} else {
|
||||
mergeList.add(zwf0012tRepository.save(Zwf0012t.builder()
|
||||
.id(Zwf0012tId.builder()
|
||||
.wkfid(wkfid)
|
||||
.wkfsq(sq.getAndIncrement())
|
||||
.build())
|
||||
.lineclsf(zwfAppr.getLineclsf())
|
||||
.abscd(zwfAppr.getAbscd())
|
||||
.bname(userOptional.get().getSabun())
|
||||
.btext(userOptional.get().getName())
|
||||
.posit(userOptional.get().getGradeNm())
|
||||
.deptn(userOptional.get().getDept().getDeptNm())
|
||||
.wkfst(zwfAppr.getLineclsf().equals("Q") ? "Q" : "I")
|
||||
.ernam(ernam)
|
||||
.erdat(erdat)
|
||||
.erzet(erzet)
|
||||
.build()));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
zwf0011tResponse.get().setApprs(Arrays.asList(ZwfApprGrpResponse.builder()
|
||||
.label(label.get())
|
||||
.value(mergeList)
|
||||
.build()));
|
||||
|
||||
SlipResponse slipResponse = SlipResponse.to(slip);
|
||||
slipResponse.setZwf0011t(zwf0011tResponse.get());
|
||||
return slipResponse;
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete(String contNo) {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: local
|
||||
Reference in New Issue
Block a user