Compare commits
2 Commits
923d74d37a
...
913e5bd678
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
913e5bd678 | ||
|
|
465cde8a16 |
@@ -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()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?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.wb.domainserver.domain.gcone.setup.cost.mapper.BOCostMapper">
|
||||||
|
|
||||||
|
<!--원가 설정 목록 조회-->
|
||||||
|
<select id="selectBOCostPriceList"
|
||||||
|
parameterType="com.wb.domainserver.domain.gcone.setup.cost.vo.BOCostVO"
|
||||||
|
resultType="dataMap">
|
||||||
|
SELECT CT_INNB
|
||||||
|
, STDR_DE
|
||||||
|
, USD_RATE
|
||||||
|
, JP_DLVY_CT
|
||||||
|
, INTL_DLVY_AMT
|
||||||
|
, PLTFOM_FEE
|
||||||
|
, EXPCT_TAX
|
||||||
|
, CSTMS_FEE
|
||||||
|
, KR_DLVY_CT
|
||||||
|
FROM GC_GOODS_COST
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 원가 설정 삭제 -->
|
||||||
|
<delete id="deleteBOCostPrice"
|
||||||
|
parameterType="com.wb.domainserver.domain.gcone.setup.cost.vo.BOCostVO" >
|
||||||
|
DELETE FROM
|
||||||
|
GC_GOODS_COST
|
||||||
|
WHERE 1=1
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 원가 설정 등록 -->
|
||||||
|
<insert id="insertBOCostPrice"
|
||||||
|
parameterType="DataMap" >
|
||||||
|
<selectKey order="BEFORE" keyProperty="ctInnb" resultType="integer">
|
||||||
|
SELECT IFNULL(MAX(CT_INNB), 0) + 1
|
||||||
|
FROM GC_GOODS_COST
|
||||||
|
</selectKey>
|
||||||
|
INSERT INTO GC_GOODS_COST (
|
||||||
|
CT_INNB,
|
||||||
|
STDR_DE,
|
||||||
|
USD_RATE,
|
||||||
|
JP_DLVY_CT,
|
||||||
|
INTL_DLVY_AMT,
|
||||||
|
PLTFOM_FEE,
|
||||||
|
EXPCT_TAX,
|
||||||
|
CSTMS_FEE,
|
||||||
|
KR_DLVY_CT
|
||||||
|
) VALUES (
|
||||||
|
#{ctInnb},
|
||||||
|
#{stdrDe},
|
||||||
|
#{usdRate},
|
||||||
|
#{jpDlvyCt},
|
||||||
|
#{intlDlvyAmt},
|
||||||
|
#{pltfomFee},
|
||||||
|
#{expctTax},
|
||||||
|
#{cstmsFee},
|
||||||
|
#{krDlvyCt}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@@ -4152,7 +4152,11 @@
|
|||||||
|
|
||||||
// 실무게 자릿수 제한
|
// 실무게 자릿수 제한
|
||||||
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
||||||
this.value = this.value.replace(/(\.\d).*/,'$1');
|
let value = this.value;
|
||||||
|
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||||
|
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||||
|
value = value.replace(/(\.\d{1}).*/, '$1'); // 소수 1자리 제한
|
||||||
|
this.value = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 하이픈 뒤에 숫자한자리만 남기기
|
// 하이픈 뒤에 숫자한자리만 남기기
|
||||||
|
|||||||
@@ -5162,7 +5162,11 @@
|
|||||||
|
|
||||||
// 실무게 자릿수 제한
|
// 실무게 자릿수 제한
|
||||||
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
||||||
this.value = this.value.replace(/(\.\d).*/,'$1');
|
let value = this.value;
|
||||||
|
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||||
|
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||||
|
value = value.replace(/(\.\d{1}).*/, '$1'); // 소수 1자리 제한
|
||||||
|
this.value = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 하이픈 뒤에 숫자한자리만 남기기
|
// 하이픈 뒤에 숫자한자리만 남기기
|
||||||
|
|||||||
@@ -5682,7 +5682,11 @@
|
|||||||
|
|
||||||
// 실무게 자릿수 제한
|
// 실무게 자릿수 제한
|
||||||
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
$(document).on('input', 'input[name="realWt_normal"]', function () {
|
||||||
this.value = this.value.replace(/(\.\d).*/,'$1');
|
let value = this.value;
|
||||||
|
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||||
|
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||||
|
value = value.replace(/(\.\d{1}).*/, '$1'); // 소수 1자리 제한
|
||||||
|
this.value = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 하이픈 뒤에 숫자한자리만 남기기
|
// 하이픈 뒤에 숫자한자리만 남기기
|
||||||
|
|||||||
309
src/main/webapp/WEB-INF/views/mngr/setup/cost/CostPriceUpdtU.jsp
Normal file
309
src/main/webapp/WEB-INF/views/mngr/setup/cost/CostPriceUpdtU.jsp
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
|
||||||
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||||
|
<%--
|
||||||
|
Class Name : CostPriceUpdtU.jsp
|
||||||
|
Description : 원가 설정 상세
|
||||||
|
Modification Information
|
||||||
|
|
||||||
|
수정일 수정자 수정내용
|
||||||
|
------- -------- ---------------------------
|
||||||
|
2026-05-29 이대환 최초 생성
|
||||||
|
--%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<%-- 공통 include --%>
|
||||||
|
<%@include file ="/WEB-INF/views/comm/mngr/Include.jsp" %>
|
||||||
|
</head>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
// 숫자 처리
|
||||||
|
$('.sep').each(function () {
|
||||||
|
fn_format_sep($(this));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/* ********************************************************
|
||||||
|
* 입력창 추가
|
||||||
|
******************************************************** */
|
||||||
|
const fn_add_emptyBox = function() {
|
||||||
|
|
||||||
|
stplatChk = false;
|
||||||
|
let trClone = '';
|
||||||
|
|
||||||
|
trClone = '<tr>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <label class="b-checkbox checkbox is-medium">'
|
||||||
|
+ ' <input type="checkbox" name="costChk" value=""><span class="check"></span>'
|
||||||
|
+ ' <input type="hidden" class="input-text number xl" name="ctInnbArr" title="원가고유번호" value="0">'
|
||||||
|
+ ' </label>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text number xl" name="stdrDeArr" title="기준일자" maxlength="8">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text digit2 xl" name="usdRateArr" title="USD 환율 (1,000 円)" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text sep xl" name="jpDlvyCtArr" title="일본 내 물류비" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text sep xl" name="intlDlvyAmtArr" title="운임비용(JP)" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text digit2 xl" name="pltfomFeeArr" title="플랫폼 수수료율" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text digit3 xl" name="expctTaxArr" title="예상세율" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text sep xl" name="cstmsFeeArr" title="통관수수료" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ ' <td>'
|
||||||
|
+ ' <div class="td-inner">'
|
||||||
|
+ ' <input type="text" class="input-text sep xl" name="krDlvyCtArr" title="운임비용(KR)" maxlength="25">'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' </td>'
|
||||||
|
+ '</tr>';
|
||||||
|
|
||||||
|
$('#tableCostSorting').append(trClone);
|
||||||
|
$('#noData').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************************************
|
||||||
|
* 입력창 삭제
|
||||||
|
******************************************************** */
|
||||||
|
const fn_remove_box = function() {
|
||||||
|
|
||||||
|
const target = $('[name=costChk]:checked');
|
||||||
|
|
||||||
|
if (target.length === 0) {
|
||||||
|
alert('항목을 선택해 주세요.');
|
||||||
|
} else {
|
||||||
|
target.each(function() {
|
||||||
|
$(this).parents('tr').remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#costAll').prop('checked', false);
|
||||||
|
const total = $('#tableCostSorting').find('tr').length;
|
||||||
|
|
||||||
|
if (total === 1) {
|
||||||
|
|
||||||
|
$('#noData').show();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$('#noData').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************************************
|
||||||
|
* 원가 설정 저장
|
||||||
|
******************************************************** */
|
||||||
|
const fn_update_cost = function () {
|
||||||
|
if (confirm('원가 설정을 <spring:message code="confirm.common.save"/>')) {
|
||||||
|
// 콤마 제거
|
||||||
|
$('.sep').each(function () {
|
||||||
|
fn_format_sep($(this), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'post',
|
||||||
|
url: '<c:url value="/mngr/setup/cost/updateCostPriceSetup"/>',
|
||||||
|
data: $('#updtForm').serialize(),
|
||||||
|
success: function () {
|
||||||
|
alert("<spring:message code="success.common.save"/>");
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fn_format_sep($(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 숫자 처리
|
||||||
|
$(document).on('input', '.number', function () {
|
||||||
|
var input = $(this).val();
|
||||||
|
$(this).val(input.replace(/[^0-9]/g, ""));
|
||||||
|
});
|
||||||
|
$(document).on('input', '.sep', function () {
|
||||||
|
fn_format_sep($(this));
|
||||||
|
});
|
||||||
|
const fn_format_sep = function ($target, unformat) {
|
||||||
|
var value = $target.val();
|
||||||
|
|
||||||
|
if (unformat == undefined) {
|
||||||
|
value = value
|
||||||
|
.replace(/[^0-9]/g, "")
|
||||||
|
.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
|
||||||
|
} else {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.val(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 자릿수 제한
|
||||||
|
$(document).on('input', '.digit2', function () {
|
||||||
|
let value = this.value;
|
||||||
|
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||||
|
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||||
|
value = value.replace(/(\.\d{2}).*/, '$1'); // 소수 2자리 제한
|
||||||
|
this.value = value;
|
||||||
|
});
|
||||||
|
$(document).on('input', '.digit3', function () {
|
||||||
|
let value = this.value;
|
||||||
|
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||||
|
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||||
|
value = value.replace(/(\.\d{3}).*/, '$1'); // 소수 3자리 제한
|
||||||
|
this.value = value;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<%-- 상단메뉴 공통화 적용 : 2023-11-30 / 박철민 추가 --%>
|
||||||
|
<%@include file ="/WEB-INF/views/comm/mngr/Header.jsp" %>
|
||||||
|
<main class="main">
|
||||||
|
<%-- 좌측메뉴 공통화 적용 : 2023-11-30 / 박철민 추가 --%>
|
||||||
|
<%@include file ="/WEB-INF/views/comm/mngr/Left.jsp" %>
|
||||||
|
<div class="content">
|
||||||
|
<div class="content__inner">
|
||||||
|
<button class="side-nav__fold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
|
||||||
|
<div class="page-title">
|
||||||
|
<h2 class="page-title__title">원가 설정</h2>
|
||||||
|
<div class="page-title__btn-container">
|
||||||
|
<button class="btn primary" onclick="fn_update_cost()">저장하기
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<form id="updtForm">
|
||||||
|
<section class="content-section">
|
||||||
|
<div class="form-control-container mb-8">
|
||||||
|
<div class="left">
|
||||||
|
<h3 class="content-section__inner-title">원가 설정</h3>
|
||||||
|
</div>
|
||||||
|
<div class="center"></div>
|
||||||
|
<div class="right">
|
||||||
|
<button type="button" class="btn primary outline xsm" onclick="fn_add_emptyBox('costChk');"><spring:message code="button.add"/></button>
|
||||||
|
<button type="button" class="btn dark xsm" onclick="fn_remove_box();"><spring:message code="button.delete"/></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="table-wrapper">
|
||||||
|
<table class="table vertical">
|
||||||
|
<caption>원가 설정</caption>
|
||||||
|
<colgroup>
|
||||||
|
<col style="width: 4%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
<col style="width: 12%;">
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<label class="b-checkbox checkbox is-medium check-all">
|
||||||
|
<input type="checkbox" value="" id="costAll"><span class="check"></span>
|
||||||
|
</label>
|
||||||
|
</th>
|
||||||
|
<th>기준일자</th>
|
||||||
|
<th>USD 환율 (1,000 円)</th>
|
||||||
|
<th>일본 내 물류비</th>
|
||||||
|
<th>운임비용(JP)</th>
|
||||||
|
<th>플랫폼 수수료율</th>
|
||||||
|
<th>예상세율</th>
|
||||||
|
<th>통관수수료</th>
|
||||||
|
<th>운임비용(KR)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tableCostSorting">
|
||||||
|
<c:if test="${not empty resultMap.costList}">
|
||||||
|
<c:forEach var="cost" items="${resultMap.costList}" varStatus="status">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label class="b-checkbox checkbox is-medium">
|
||||||
|
<input type="checkbox" name="costChk" value=""><span class="check"></span>
|
||||||
|
<input type="hidden" class="input-text number xl" name="ctInnbArr" title="원가고유번호" value="${cost.ctInnb}">
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text number xl" name="stdrDeArr" title="기준일자" maxlength="8" value="${cost.stdrDe}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text digit2 xl" name="usdRateArr" title="USD 환율 (1,000 円)" maxlength="25" value="${cost.usdRate}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text sep xl" name="jpDlvyCtArr" title="일본 내 물류비" maxlength="25" value="${cost.jpDlvyCt}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text sep xl" name="intlDlvyAmtArr" title="운임비용(JP)" maxlength="25" value="${cost.intlDlvyAmt}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text digit2 xl" name="pltfomFeeArr" title="플랫폼 수수료율" maxlength="25" value="${cost.pltfomFee}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text digit3 xl" name="expctTaxArr" title="예상세율" maxlength="25" value="${cost.expctTax}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text sep xl" name="cstmsFeeArr" title="통관수수료" maxlength="25" value="${cost.cstmsFee}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="td-inner">
|
||||||
|
<input type="text" class="input-text sep xl" name="krDlvyCtArr" title="운임비용(KR)" maxlength="25" value="${cost.krDlvyCt}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
<tr id="noData" style="display: none;"><td class="row-no-data" colspan="9">원가를 설정해 주세요.</td></tr>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${empty resultMap.costList}">
|
||||||
|
<tr id="noData"><td class="row-no-data" colspan="9">원가를 설정해 주세요.</td></tr>
|
||||||
|
</c:if>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -27,52 +27,11 @@
|
|||||||
/* ********************************************************
|
/* ********************************************************
|
||||||
* 입력창 추가
|
* 입력창 추가
|
||||||
******************************************************** */
|
******************************************************** */
|
||||||
const fn_add_emptyBox = function(_target) {
|
const fn_add_emptyBox = function() {
|
||||||
|
|
||||||
stplatChk = false;
|
stplatChk = false;
|
||||||
let count = 0;
|
|
||||||
let trClone = '';
|
let trClone = '';
|
||||||
|
|
||||||
if (_target === 'clauseChk') {
|
|
||||||
|
|
||||||
count = $('#tableSorting').children('tr').length + 1;
|
|
||||||
|
|
||||||
trClone = '<tr>'
|
|
||||||
+ ' <td>'
|
|
||||||
+ ' <label class="b-checkbox checkbox is-medium">'
|
|
||||||
+ ' <input type="checkbox" name="clauseChk" value=""><span class="check"></span>'
|
|
||||||
+ ' </label>'
|
|
||||||
+ ' </td>'
|
|
||||||
+ ' <td>'
|
|
||||||
+ ' <div class="select-box">'
|
|
||||||
+ ' <select class="full" name="clause" id="clause' + count + '" title="약관구분" onchange="fn_select_subClause(this);">'
|
|
||||||
+ ' <option value="" selected >선택하세요</option>'
|
|
||||||
+ ' <c:forEach var="cgn002" items="${resultMap.cgn002}" varStatus="status">'
|
|
||||||
+ ' <option value="${cgn002.cd}"><c:out value="${cgn002.cdNm}"/></option>'
|
|
||||||
+ ' </c:forEach>'
|
|
||||||
+ ' </select>'
|
|
||||||
+ ' </div>'
|
|
||||||
+ ' </td>'
|
|
||||||
+ ' <td>'
|
|
||||||
+ ' <div class="select-box privacyPolicy-select">'
|
|
||||||
+ ' <select class="full" name="stplatInnbArr" id="privacyPolicy' + count + '" title="약관 내용">'
|
|
||||||
+ ' <option value="" selected >약관 구분을 선택하세요</option>'
|
|
||||||
+ ' </select>'
|
|
||||||
+ ' </div>'
|
|
||||||
+ ' </td>'
|
|
||||||
+ ' <td>'
|
|
||||||
+ ' <div class="manage-btn-container">'
|
|
||||||
+ ' <a href="#clause-info-modal" rel="modal:open" class="btn xsm primary outline privacy" onclick="fn_select_clauseInformation(\'new\');"><spring:message code="button.view"/></a>'
|
|
||||||
+ ' </div>'
|
|
||||||
+ ' </td>'
|
|
||||||
+ '</tr>';
|
|
||||||
|
|
||||||
$('#tableSorting').append(trClone);
|
|
||||||
$('#clause' + count).niceSelect();
|
|
||||||
$('#privacyPolicy' + count).niceSelect();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
trClone = '<tr>'
|
trClone = '<tr>'
|
||||||
+ ' <td>'
|
+ ' <td>'
|
||||||
+ ' <label class="b-checkbox checkbox is-medium">'
|
+ ' <label class="b-checkbox checkbox is-medium">'
|
||||||
@@ -93,7 +52,6 @@
|
|||||||
|
|
||||||
$('#tableSiteSorting').append(trClone);
|
$('#tableSiteSorting').append(trClone);
|
||||||
$('#noData').hide();
|
$('#noData').hide();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -102,9 +60,9 @@
|
|||||||
/* ********************************************************
|
/* ********************************************************
|
||||||
* 입력창 삭제
|
* 입력창 삭제
|
||||||
******************************************************** */
|
******************************************************** */
|
||||||
const fn_remove_box = function(_target) {
|
const fn_remove_box = function() {
|
||||||
|
|
||||||
const target = $('[name=' + _target + ']:checked');
|
const target = $('[name=siteChk]:checked');
|
||||||
|
|
||||||
if (target.length === 0) {
|
if (target.length === 0) {
|
||||||
alert('항목을 선택해 주세요.');
|
alert('항목을 선택해 주세요.');
|
||||||
@@ -114,9 +72,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_target === 'clauseChk') {
|
|
||||||
$('#clauseAll').prop('checked', false);
|
|
||||||
} else {
|
|
||||||
$('#siteAll').prop('checked', false);
|
$('#siteAll').prop('checked', false);
|
||||||
const total = $('#tableSiteSorting').find('tr').length;
|
const total = $('#tableSiteSorting').find('tr').length;
|
||||||
|
|
||||||
@@ -128,7 +83,6 @@
|
|||||||
|
|
||||||
$('#noData').hide();
|
$('#noData').hide();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +127,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="center"></div>
|
<div class="center"></div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<button type="button" class="btn primary outline xsm" onclick="fn_add_emptyBox('siteChk');"><spring:message code="button.add"/></button>
|
<button type="button" class="btn primary outline xsm" onclick="fn_add_emptyBox();"><spring:message code="button.add"/></button>
|
||||||
<button type="button" class="btn dark xsm" onclick="fn_remove_box('siteChk');"><spring:message code="button.delete"/></button>
|
<button type="button" class="btn dark xsm" onclick="fn_remove_box();"><spring:message code="button.delete"/></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-wrapper">
|
<div class="table-wrapper">
|
||||||
|
|||||||
Reference in New Issue
Block a user