feat: 샘플 화면 반영

dev
Jonguk. Lim 6 months ago
parent 1ebcc15252
commit e604765c7b

@ -12,19 +12,39 @@ import lombok.RequiredArgsConstructor;
@Controller
@RequestMapping(
name = "Nims 관리",
value = {"/adds/nims"}
value = {"/adds/nims/v1"}
)
public class TestController extends AbstractController {
@Value("${app.api.host:}")
private String apiHost;
@RequestMapping(
name = "Nims 메인",
value = {"/barcode/main.do"}
name = "Nims 바코드 리더",
value = {"/barcodeForm.do"}
)
public ModelAndView main() {
public ModelAndView barcodeForm() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/barcode-read");
mav.setViewName("adds/nims/barcode-main");
return mav.addObject("apiHost", apiHost);
}
@RequestMapping(
name = "Nims 폐기신청서접수",
value = {"/dsuseMgtReceiptForm.do"}
)
public ModelAndView dsuseMgtReceiptForm() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseMgtReceipt-main");
return mav.addObject("apiHost", apiHost);
}
@RequestMapping(
name = "Nims 폐기 통보[결과] 처리",
value = {"/dsuseMgtRsltForm.do"}
)
public ModelAndView dsuseMgtRsltForm() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseMgtRslt-main");
return mav.addObject("apiHost", apiHost);
}
}

@ -17,7 +17,7 @@
<main class="wrapper" style="padding-top:2em">
<section class="container" id="demo-content">
<h3 class="title">QR code Scan or image upload</h3>
<h3 class="title">바코드(이미지) scan</h3>
<div id="divBtnScan">
@ -371,7 +371,3 @@
}
</script>
</body>
</html>

@ -0,0 +1,90 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<title>폐기 신청서 접수</title>
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://unpkg.com/normalize.css@8.0.0/normalize.css">
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://unpkg.com/milligram@1.3.0/dist/milligram.min.css">
<script src="<c:url value="/resources/3rd-party/sneat/libs/jquery/jquery.js"/>"></script>
<script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script>
<main class="wrapper" style="padding-top:2em">
<input type="file" id="img1" name="img" accept="image/*"><br>
<input type="file" id="img2" name="img" accept="image/*"><br>
<button id="btnSave">save</button>
</main>
<script type="text/javascript">
document.querySelector("#btnSave").addEventListener("click", function () {
let dsuseMgt =
{
userId: "api-user",
prgrsSttsCd: "01",
bsshCd: "H00008333",
rndDtlRptCnt: 2,
dsusePrvCd: "04"
};
let dsuseMgtDtls = [
{
prductCd: "8806717024900",
prductNm: "베리콜시럽",
minDistbQy: 1,
pceQy: 1,
mnfNo: "A1111",
prdValidDe: "20300303",
mnfSeq: "A11111111",
dsuseQy: 10
},
{
prductCd: "8806718050823",
prductNm: "아쿠아폴주20밀리리터(프로포폴) (20㎖)",
minDistbQy: 1,
pceQy: 5,
mnfNo: "A1111",
prdValidDe: "20300303",
mnfSeq: "A11111111",
dsuseQy: 30
}
];
let formData = new FormData();
formData.append("dsuseMgtJsonStr", JSON.stringify(dsuseMgt));
formData.append("dsuseMgtDtlsJsonStr", JSON.stringify(dsuseMgtDtls));
$("input[type=file]").each(function (i) {
formData.append("dsusePrdImgFiles", $('input[type=file]')[i].files[0]);
});
$.ajax({
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtReceipt" />',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function (res) {
console.log(res);
if (!res.success) {
alert(res.code + ':' + res.message);
return false;
}
console.log(res.data);
},
error: function (error) {
console.log(error);
if (error.responseJSON && typeof error.responseJSON === 'object') {
console.log(error.responseJSON);
}
}
});
});
</script>

@ -0,0 +1,70 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<title>폐기 신청서 접수</title>
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://unpkg.com/normalize.css@8.0.0/normalize.css">
<link rel="stylesheet" rel="preload" as="style" onload="this.rel='stylesheet';this.onload=null"
href="https://unpkg.com/milligram@1.3.0/dist/milligram.min.css">
<script src="<c:url value="/resources/3rd-party/sneat/libs/jquery/jquery.js"/>"></script>
<script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script>
<main class="wrapper" style="padding-top:2em">
<input type="file" id="img1" name="img" accept="image/*"><br>
<input type="file" id="img2" name="img" accept="image/*"><br>
<button id="btnSave">save</button>
</main>
<script type="text/javascript">
document.querySelector("#btnSave").addEventListener("click", function () {
let dsuseMgtRslt =
{
dscdmngId: "2024050001",
userId: "api-user",
prgrsSttsCd: "06",
hdrDe: "20240506",
rptDe: "20240506",
dsuseSeCd: "1",
dsuseMthCd: "3",
dsuseLoc: "보건소 소각장",
dsuseDe: "20240506"
};
let formData = new FormData();
formData.append("dsuseMgtRsltJsonStr", JSON.stringify(dsuseMgtRslt));
$("input[type=file]").each(function (i) {
formData.append("dsuseDsuseImgFiles", $('input[type=file]')[i].files[0]);
});
$.ajax({
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtRslt" />',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function (res) {
console.log(res);
if (!res.success) {
alert(res.code + ':' + res.message);
return false;
}
console.log(res.data);
},
error: function (error) {
console.log(error);
if (error.responseJSON && typeof error.responseJSON === 'object') {
console.log(error.responseJSON);
}
}
});
});
</script>
Loading…
Cancel
Save