@@ -0,0 +1,34 @@
|
||||
package com.wb.domainserver.domain.gcone.setup.cost.mapper;
|
||||
|
||||
import com.wb.domainserver.domain.gcone.setup.cost.vo.BOCostVO;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface BOCostMapper {
|
||||
|
||||
/**
|
||||
* 원가 설정 목록 조회
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
public List<DataMap> selectBOCostPriceList(BOCostVO vo);
|
||||
|
||||
/**
|
||||
* 원가 설정 삭제
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
public int deleteBOCostPrice(BOCostVO vo);
|
||||
|
||||
/**
|
||||
* 원가 설정 추가
|
||||
* @param dm
|
||||
* @return
|
||||
*/
|
||||
public int insertBOCostPrice(DataMap dm);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.wb.domainserver.domain.gcone.setup.cost.service;
|
||||
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.service.BOMaComncdService;
|
||||
import com.wb.domainserver.domain.gcone.setup.cost.mapper.BOCostMapper;
|
||||
import com.wb.domainserver.domain.gcone.setup.cost.vo.BOCostVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.exception.code.ErrorCode;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import com.wb.domainserver.util.string.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 원가 설정 BO Serivce
|
||||
*
|
||||
* @author 이대환
|
||||
* @version 1.0
|
||||
* @see <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2026-05-29 이대환 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
* @since 2026-05-29
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BOCostService {
|
||||
@Autowired
|
||||
private BOMaComncdService bOMaComncdService;
|
||||
@Autowired
|
||||
private BOCostMapper mapper;
|
||||
|
||||
/**
|
||||
* 원가 설정 목록 조회
|
||||
* @param vo
|
||||
* @return List<DataMap>
|
||||
*/
|
||||
public List<DataMap> selectBOCostPriceList(BOCostVO vo) {
|
||||
List<DataMap> costList = new ArrayList<>();
|
||||
costList = mapper.selectBOCostPriceList(vo);
|
||||
|
||||
return costList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 원가 설정 수정
|
||||
* @param vo
|
||||
*/
|
||||
@Transactional
|
||||
public DataMap updateBOCostPriceSetup(BOCostVO vo) {
|
||||
DataMap message = new DataMap();
|
||||
|
||||
try {
|
||||
mapper.deleteBOCostPrice(vo);
|
||||
|
||||
DataMap paramMap = new DataMap();
|
||||
paramMap.put("regusr", vo.getRegusr());
|
||||
|
||||
int[] ctInnbArr = vo.getCtInnbArr();
|
||||
if (!ObjectUtils.isEmpty(ctInnbArr)) {
|
||||
for (int i = 0; i < ctInnbArr.length; i++) {
|
||||
paramMap.put("stdrDe", vo.getStdrDeArr()[i]);
|
||||
paramMap.put("usdRate", vo.getUsdRateArr()[i]);
|
||||
paramMap.put("jpDlvyCt", vo.getJpDlvyCtArr()[i]);
|
||||
paramMap.put("intlDlvyAmt", vo.getIntlDlvyAmtArr()[i]);
|
||||
paramMap.put("pltfomFee", vo.getPltfomFeeArr()[i]);
|
||||
paramMap.put("expctTax", vo.getExpctTaxArr()[i]);
|
||||
paramMap.put("cstmsFee", vo.getCstmsFeeArr()[i]);
|
||||
paramMap.put("krDlvyCt", vo.getKrDlvyCtArr()[i]);
|
||||
|
||||
mapper.insertBOCostPrice(paramMap);
|
||||
}
|
||||
}
|
||||
|
||||
message.put("result", "success");
|
||||
} catch (WnbtRestException wre) {
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
throw new WnbtRestException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.wb.domainserver.domain.gcone.setup.cost.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class BOCostVO extends AbstractVO {
|
||||
|
||||
/** 원가 고유번호 */
|
||||
private int[] ctInnbArr;
|
||||
|
||||
/** 기준일자 */
|
||||
private int[] stdrDeArr;
|
||||
|
||||
/** USD 환율 (1,000 円) */
|
||||
private BigDecimal[] usdRateArr;
|
||||
|
||||
/** 일본 내 물류비 */
|
||||
private int[] jpDlvyCtArr;
|
||||
|
||||
/** 운임비용(JP) */
|
||||
private int[] intlDlvyAmtArr;
|
||||
|
||||
/** 플랫폼 수수료율 */
|
||||
private BigDecimal[] pltfomFeeArr;
|
||||
|
||||
/** 예상세율 */
|
||||
private BigDecimal[] expctTaxArr;
|
||||
|
||||
/** 통관수수료 */
|
||||
private int[] cstmsFeeArr;
|
||||
|
||||
/** 운임비용(KR) */
|
||||
private int[] krDlvyCtArr;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.wb.domainserver.domain.mngr.setup.cost;
|
||||
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.domain.gcone.setup.cost.service.BOCostService;
|
||||
import com.wb.domainserver.domain.gcone.setup.cost.vo.BOCostVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtResponseBody;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.communicate.ValidateResultConverter;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* 원가 설정 Controller
|
||||
*
|
||||
* @author 이대환
|
||||
* @version 1.0
|
||||
* @see <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2026-05-29 이대환 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
* @since 2026-05-29
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/mngr/setup/cost")
|
||||
@Slf4j
|
||||
public class CostController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
/** 공통 메시지 처리를 위한 메시지 객체 */
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
|
||||
@Autowired
|
||||
private BOCostService service;
|
||||
|
||||
/**
|
||||
* 원가 설정 페이지 이동
|
||||
*
|
||||
* @param vo
|
||||
* @return CostPriceUpdtU.jsp
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectCostPriceSetup")
|
||||
public String selectCostPriceSetup(BOCostVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
DataMap content = new DataMap();
|
||||
|
||||
content.put("costList", service.selectBOCostPriceList(vo));
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
|
||||
return "mngr/setup/cost/CostPriceUpdtU";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 원가 설정 수정
|
||||
*
|
||||
* @param vo
|
||||
* @return ResponseEntity<WnbtResponse>
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@PostMapping(value = "/updateCostPriceSetup", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateCostPriceSetup(@Validated BOCostVO vo, BindingResult bindingResult, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
|
||||
DataMap message = service.updateBOCostPriceSetup(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user